rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Fri Nov 05, 2004 8:54 am |
|
|
Look at the data sheets for the chips. It doesn't look like either one has I2C hardware in the chip.
Next, read the #use i2c entry in the compiler help file.
In general, the compiler tries to use built-in hardware if you specify the hardware connected pins. There are parameters for the #use i2c that let you override the hardware and force the compiler to include the bit-banging versions. If you were using the 16F877A (for example) then you have the choice of implementing your i2c routines using on-chip hardware or soley through software.
If the chip you have selected does not have hardware to support the function, then the compiler will insert the bit-banging versions.
As far as I know, there are 5 library routines, I2C_POLL, I2C_READ, I2C_START, I2C_STOP and I2C_WRITE supported by the compiler. Use the help file to read about each one.
Find some of the i2c example code and also look at some of the i2c eeprom driver code included with the compiler. You can compile the code and look at the LST file to see if the compiler is using the chip's hardware or bit-banging.
Rob Young _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|