Go Down

Topic: PCF8574 initial state? (Read 5095 times) previous topic - next topic

Jeremyvnc

So, I have a board with a PCF8574 (this one: http://parts.digikey.com/1/parts/498454-ic-i-o-expander-i2c-8b-20tssop-pcf8574pwr.html).

All 8 pins are set as outputs and each one controls a MosFET which turns on random DC devices like water valves and such.

The problem I have is, the PCF8574 defaults to INPUT on startup which is turning on my MosFETs until my program has enough time to start, begin i2C and set all the pins to OUTPUTS.  This can take less than a second to almost 2 seconds.  Since I'm controlling water and other devices, this starts spraying water for a second or 2.

Does anyone know if there is a way to make the PCF8574 default to output LOW on power-up or any other way around this?

Thanks for any help!
Jeremy


PaulS

Quote
All 8 pins are set as outputs and each one controls a MosFET which turns on random DC devices like water valves and such.

Turns on a random device, huh? How are you ever supposed to get the chip to turn on a specific device?


Jago

Hi,
my solution for this problem was to switch the Ground.
In your case I think you need a assembly part that invert the signal, like eg a PNP Transistor.
Then you have to write a zero to the Output to switch the divice on.
MfG Jago

kg4wsv

pulldown resistor to keep things sane until the 8574 is configured?

-j

Jago

I think this will not work, the 8574 can only pull up 0,3mA, sadly....

kg4wsv

I meant external pulldown.  Internal wouldn't help, as the chip isn't under control when the problem occurs.

-j

Jago

Okay, maybe my english is not god enough to understand what you mean.
I imagine it in this way, there is a external pulldown risistor that pull the 0,3mA High current down to Ground. This will work, the valves will not switching on. But how shoud the valves switching on when the pcf8574 is configured? In this case you have to switch off the pulldown risistor and when you like to do this it´s much easier to invert the signal. (I'm not a expert for MosFET's, but if I´m not wrong there are types of FET's that switching off in Highstate)
Have I understood you totaly wrong?

kg4wsv

Looks like you can ignore what I said; the datasheet says:

Quote
At power on, the I/Os are high.


Which means that my assumption of a floating output was incorrect.

-j

Go Up