ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

THROUGH THE LOOKING GLASS


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

THROUGH THE LOOKING GLASS

Lessons from the Trenches Taking a Look at the PIC18Cxxx Series
by David Brobst

Start ý PIC18Cxxx Chips ý Memory ý Data Memory ý Advanced Indirect Addressing ý Deep and Accessible Stack ý Interrupts ý Power-On Features ý Clock Speed ý 10-Bit A/D ý Hardware Multiplier ý Timers ý CCP/PWM ý USART ý I2C Master ý Table Read/Write ý Current Status ý Sources and PDF

I2C MASTER

Almost from the beginning, controllers supported slave mode I2C communication. However, this was of limited use because most embedded systems have a single controller that acts as a master and talks to I2C peripherals such as EEPROM, real-time clocks, and A/Ds. So, the hardware I2C port sat dormant on many a mid-range PIC device while the controller used I2C devices and communicated to them with a bit-banged firmware solution. Fortunately, the new PIC18Cxxx series rectifies this gaffe and provides a hardware I2C master solution.

The new I2C peripheral fully supports all master modes of the Philips I2C specification in the form of Master Synchronous Serial Port (MSSP). Multi-master mode, 7- and 10-bit addressing, clock arbitration, and 400-kHz mode are supported by the new MSSP. I2C is an involved communication protocol, and it is easy to lose the forest through the trees. However, it is possible to fully realize the benefits of the I2C port on the PIC18Cxxx. Listing 2 gives some sample code that shows how easy it is to implement I2C communication. Note that the code is basic and does not test for all of the various error conditions.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ