I have a problem when i want to use I2CWRITE on 2 different adressed PCF8574 chips
here's a snippet of my code:
pic16F876a at 8 Mhz crystal
ADRESS1 con %01110000
ADRESS2 con %01111110
DEFINE I2C_HOLD 1
DEFINE I2C_SLOW 1
SCL var portc.3
SDA var portc.4
i2cwrite SDA,SCL,ADRESS1,[0]
pause 50
i2cwrite SDA,SCL,ADRESS2,[0]
pause 50
start:
'this is just a test !
if portb.6=1 then out0=2
if portb.7=1 then out1=4
i2cwrite SDA,SCL,ADRESS1,out0
pause 50
i2cwrite SDA,SCL,ADRESS2,out2
pause 50
goto start
this is what happens:
port 6 should set output 2 out PCF at addres 1 and port7 should set output 4 out PCF at addres 2, but when i do it like in the example, if i activate port 7
then output 4 of PCF at adress1 is activated instead of output 4 of PCF 2
What goes wrong here,
hardware (chips etc) have been replaced several times, adresses also
who encountered this problem also ?
Bookmarks