Hi all!
I have a bit of problems with this PCF8574 port expander. The data sheet clearly shows that the device will SOURCE or SINK 25ma per output. So I designed a board with this chip on the I2C bus (there is also an RTC and an eeprom on the same bus). The outputs of this chip are connected directly to the inputs of a ULN2003D array. I'm only using them as outputs.
The idea was that I would use the outputs of the port expander to control bigger (off board) relays.
However, what I found was that, while the chip would respond to commands on the bus it would only SINK current and, try as I might, I could not get it to source more than a few hundred micro amps. (i've tried several chips - all the same)
I added some 4k7 pullups to the inputs of the ULN2003 which turn them on at startup. If I write a 0 to an appropriate bit of the control byte the chip will happily sink sufficeient current to turn the relay off and keep it off until I write a 1 to the control byte.
2 problems with that approach (well 3 if you count not understanding why something is happening as a problem) - first, it increases the parts count (minor problem on an SMT board) and much more importantly, all coneceted relays will pulse ON briefly at power on - not a good look! Even if I write the outputs low at the very earliest opportunity in the code - they are on for a couple of ms before being shut off.
I've scoured the data sheet several times and can't see any explanation there - but I did notice in para 7.3 the following quote
"A quasi-bidirectional I/O can be used as an input or output without the use of a control signal for data direction (see Fig.15). At power-on the I/Os are HIGH. In this mode only a current source to VDD is active. An additional strong pull-up to VDD allows fast rising edges into heavily loaded outputs. These devices turn on when an output is written HIGH, and are switched off by the negative edge of SCL. The I/Os should be HIGH before being used as inputs."
Which I don't fully understand
I wonder if anyone here has any experience with this chip and could perhaps shed some light ?
The data sheet is at http://www.alldatasheet.com/datasheet-pdf/pdf/18212/PHILIPS/PCF8574.html
My plan at the moment is to add the pullups but to disable the supply to the relays until a few seconds after the circuit powers up and stabilises - not very elegant, but it sould get me out of trouble.
Very much appreciate any help.
I have a bit of problems with this PCF8574 port expander. The data sheet clearly shows that the device will SOURCE or SINK 25ma per output. So I designed a board with this chip on the I2C bus (there is also an RTC and an eeprom on the same bus). The outputs of this chip are connected directly to the inputs of a ULN2003D array. I'm only using them as outputs.
The idea was that I would use the outputs of the port expander to control bigger (off board) relays.
However, what I found was that, while the chip would respond to commands on the bus it would only SINK current and, try as I might, I could not get it to source more than a few hundred micro amps. (i've tried several chips - all the same)
I added some 4k7 pullups to the inputs of the ULN2003 which turn them on at startup. If I write a 0 to an appropriate bit of the control byte the chip will happily sink sufficeient current to turn the relay off and keep it off until I write a 1 to the control byte.
2 problems with that approach (well 3 if you count not understanding why something is happening as a problem) - first, it increases the parts count (minor problem on an SMT board) and much more importantly, all coneceted relays will pulse ON briefly at power on - not a good look! Even if I write the outputs low at the very earliest opportunity in the code - they are on for a couple of ms before being shut off.
I've scoured the data sheet several times and can't see any explanation there - but I did notice in para 7.3 the following quote
"A quasi-bidirectional I/O can be used as an input or output without the use of a control signal for data direction (see Fig.15). At power-on the I/Os are HIGH. In this mode only a current source to VDD is active. An additional strong pull-up to VDD allows fast rising edges into heavily loaded outputs. These devices turn on when an output is written HIGH, and are switched off by the negative edge of SCL. The I/Os should be HIGH before being used as inputs."
Which I don't fully understand
I wonder if anyone here has any experience with this chip and could perhaps shed some light ?
The data sheet is at http://www.alldatasheet.com/datasheet-pdf/pdf/18212/PHILIPS/PCF8574.html
My plan at the moment is to add the pullups but to disable the supply to the relays until a few seconds after the circuit powers up and stabilises - not very elegant, but it sould get me out of trouble.
Very much appreciate any help.