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.
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 06: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.
I figured out the reason, and it is not the code.
For some reason, PCF8575 can't drive ULN2803.
When I run it alone, outputs change as they should do
but when I connect output to ULN2803, output voltage of PCF8575 changes only from 0 to 0.6 volts and ULN2803 does not open.
Solved.
Output current of PCF8575 is not enough to drive ULN2803, so I had to add 2.2K pull-up resistors, and now it works just fine.
It makes no sense. From datasheet, page 7 and figures 6 and 10, seems that the 8575 can drive more than 25mA.
I am sure that ULN needs much less than that. Maybe you have a faulty chip? Be very careful with static discharge (ESD) problems.
Ioannis
Bookmarks