Set PCF8574P with Picaxe18X

MDOGLIONI

New Member
And' banal but it doesn't work
I want set the PIN of the PCF8574P to 1 and after few zero seconds but it doesn't work .
This example is for a simple Test necessary for expand the io port
I attach the the scheme of connection .
where am I wrong?

The Simple Code i2C protocol :
i2cSlave %01000000 ,i2cSlow, i2cByte
%0100 Defaut Adress + 000 ( for A0;A1;A2 Adresses ) +0 ( Write mode)

Main :

writei2c 0,(255) ' Set All pin to 1
pause 2000
writei2c 0,(0) ' set all pin to 0
pause 2000

goto Main :


Thank .
 

Attachments

westaust55

Moderator
Welcome to the PICAXE forum.

How are you testing that the outputs are high?
If you are using LED's the output (source) current capability of the PCF8574 is extremely low (from memory 0.3mA). They can sink 20 milliAmps per pin when low however.

EDIT:
also in your program:
1. where you have label, the colon ( : ) must immediately follow the name with no spaces.
2. when a label is used after a IF...THEN or GOTO command you do not include the colon

Code:
; The Simple Code i2C protocol :
i2cSlave %01000000 ,i2cSlow, i2cByte 
; %0100 Defaut Adress + 000 ( for A0;A1;A2 Adresses ) +0 ( Write mode)

Main:

writei2c (255) ' Set All pin to 1
pause 2000
writei2c (0) ' set all pin to 0 
pause 2000

goto Main
 
Last edited:
Top