This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCF8574: How to set up for a dedicated read operation.

Part Number: PCF8574
Other Parts Discussed in Thread: TCA9538, TCA9534A, , TCA6408A, TCA9554A,

Hi

I am using the IO expander to read from a low impedance data bus.

How do I configure the IO pin to guarantee the following does not happen If the device were to WRITE hi or lo accidentally:

  • Device will not get damage by trying to source or sink the data bus value.
  • Device will not change the data bus value (sink Data Bus to ground on low write)

I was think of using a pull up resistor as shown in the data sheet and a diode going from the IOpin to the  Data Bus.

Will this work? I am kind of confused about the output stage of this thing and I need to know to how guarantee the device will not get damage or affect the data bus.

Thanks

  • Hey Tony,

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    "I am kind of confused about the output stage of this thing and I need to know to how guarantee the device will not get damage or affect the data bus."

    The output of the device is basically just a CMOS set up (push pull architecture) where you can either pull current into GND through a FET or source current through a FET from Vcc. Only one should be on at a time (this assumes ideal conditions where shoot through current does not occur)

    You can see above only one FET will be on at a time and when the PFET is on, it will source 100uA of current (max spec'd looks like 300uA) and pull up to Vcc. So writing high doesn't look like a concern. I would say writing low would be the issue here.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    To ensure the output low does not damage the data bus you can simply just put a resistor in series with the GPIO. Size the series resistor to be what the worst case scenario would be when the fault condition occurs.

    Ex. Lets say the data bus is 5V high (assume push pull architecture is pulling 5V high) and you accidentally set GPIO output low. Lets also assume the push pull FETs impedances on the data bus and GPIO are both 25 ohms. This gives us path from Vcc to GND with an effective resistance of 50 ohms. This will mean 100mA could be pulled through both FETs and exceed the maximum allowed current resulting in damage. If maximum allowed current is 10mA, then V=I(Rdata+Rgpio+Rseries) where we want to solve for Rseries.

    Solved: Rseries >= V/I-(Rdata+Rgpio)

    In this example R series would be 450 ohms.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    "How do I configure the IO pin to guarantee the following does not happen If the device were to WRITE hi or lo accidentally:"

    May I ask why you chose the PCF8574? We have other 8 bit GPIOs which can do the same as the PCF and come at a similar price point or better. (TCA6408A, TCA9554A, TCA9534A, TCA9538)

    Also with these newer devices it is harder to accidentally output high or low because you would have to change the configuration ports to an output first (start up it is an input). If you wrote to the output registers a high or a low while the configuration registers are set as an input then nothing would happen. You also get the advantage of controlling GPIOs separately to be inputs or outputs rather than all at the same time.

    Thanks,

    -Bobby

  • I use the PCF8574 because its TO.


    One more question. Do I also NEED pull resistors on the Inputs if I am only going to use it in read mode?
    The Data Sheet and App note mention to do this, something about setting the IO Hi before reading. I think that is only for using both read/write operations, preventing the device sinking to ground like you just mentioned.

    Thanks
    Tony
  • I just need an answer to my pullup resistor question in the reply.
  • Tony,

    Just out of curiosity what does TO mean?

    "One more question. Do I also NEED pull resistors on the Inputs if I am only going to use it in read mode? "

    I believe the pull up resistor is there to ensure the input is not floating. In the case it is floating, it is possible for the device to experience shoot through current because the CMOS are partially conducting resulting in unwanted current draw.

    So the answer to the question of whether or not you need it is no you don't if your application does not require power efficiency and don't care about shoot through currents. I would still design a spot for it on a PCB but just leave it open.

    Lastly, if you are going to use this device, i suggest the PCF8574A version. It is pin to pin compatible and fixes issues the non A version may see. (also more cost competitive)

    -Bobby

  • Ok thank you.


    by TO i meant through hole. For the transistor packages TO-XX means through hole.

    Cause I work transistors everyday I say out of force of habit.