Commands to the PCF should be an even number of bytes (one for each port), and you seem to be showing 3.
What's the extra byte after the address?
Commands to the PCF should be an even number of bytes (one for each port), and you seem to be showing 3.
What's the extra byte after the address?
I tried to "bruteforce" all possible address locations - no change.
The extra byte is write statement, as said in datasheet?
![]()
PBP handles the read write bit if I remember correctly, leave your 0 out
this is my code
ADDR=78 PORTBYTE IS VALUE FOR PORTBITS
i2cwrite sda,scl,ADDR,PORTBYTE 'ENSURE ALL OFF ON POWER UP
So I think your code should be
I2CWRITE SDAM,SCLM,%01000000,[%11111111,%11111111] 'enable outputs
Meant to have said my code is for the 8 port version, the 16 port version would have another byte added after, as you have got.
"The extra byte is write statement, as said in datasheet?"
Your extra byte is a bit not byte.
Last edited by aerostar; - 22nd October 2023 at 07:39.
Yes, with 8574 I also had no issues....
That looks correct to me (an even number of bytes, one for each port), and matches the datasheet shown in post #4.So I think your code should be
I2CWRITE SDAM,SCLM,%01000000,[%11111111,%11111111] 'enable outputs
I think there is a hardware issue.
That code works with standalone module with PCF8575. But does not work with the chip directly soldered to my PCB, so I will swap the IC today later and see, if there's any difference.
Bookmarks