PDA

View Full Version : Pcf8574 & 16f877



Wirecut
- 11th July 2008, 02:26
Hi to all.

I need to use the PCF8574 to increase the number of I/O pins. I have e trouble to work with it.

I use:

SCL var PORTC.3 ' Clock pin pull up 4.7K
SDA var PORTC.4 ' Data pin pull up 4.7K

Cont = %01001000 'address of PCF8574 bits: A0=0 A1=0 A2=1

start:
for v = 0 to 255
toggle LEDRED
I2CWRITE SDA,SCL,Cont,[%11111111]
PAUSE 500
I2CWRITE SDA,SCL,Cont,[%00000000]
PAUSE 500
hserout ["v=", dec v, 13,10]
next v
toggle LEDGRE

goto start
End


All works correctly but the I/O pins on the PCF8574 do not flip.

Do you have any suggestions?

Ciao

Leo

skimask
- 11th July 2008, 14:32
I need to use the PCF8574 to increase the number of I/O pins. I have e trouble to work with it.
Have you got a PCF8574 or PCF8574A?
Control bytes are different between the two...

Wirecut
- 11th July 2008, 14:49
Hi

problem solved. I have swapped SDA with SCL. Now work perfectly.

Thanks skimask for your suggestion.

Ciao

Leo