Table 2-1 of the data sheet Says this about pin A2
If you are still using the schematic from MeLabs then...Non-Configurable Chip Select.
This pin must be hard wired to
logical 1 state (VCC). Device
will not operate with this pin
left floating or held to logical 0
(VSS)
The other thing I see in the data sheet is the last bit of the control byte sets Read or Write.
0 = READ
1 = WRITE
And you may have to add this but try the above stuff firstCode:contR CON %10100000 contW CON %10100001 I2CWRITE PORTB.1,PORTB.4,contW,addr,[20] PAUSE 10 'Is that long enough? I2CREAD PORTB.1,PORTB.4,contR,addr,[B1]
DEFINE I2C_SLOW 1
But all the above might be a bunch of hooey. I have not used this chip...





Bookmarks