PCF8574 i2c port extender: maximum current quesiton

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm having some trouble with my PCF8574 I²c port extender chip, possibly related to output current. I've successfully implemented 3 other of these chips, but this is the only one with relatively high output current. It started acting weird (micro controller, atmega168, hangs on it) when I decreased the loading resistor on the output from 47k to 10k.

Anyway, I'm confused about the maximum output current. The datasheet says under limiting values for I/O's:

  • LOW level output current: min = 10 mA, typ = 25 mA.
  • HIGH level output current: min = 30 µA, max = 300 µA.

These are my questions:

  • Why is the max current for the low level so much higher? Should there be no current when the output is low?
  • The features page says it has high current output capability for directly driving LEDs. A led needs about 20 mA, so how can that work with 300µA?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is always far easier to sink current rather than source current. So you connect your LED anode + resistor to 5V. The cathode goes to the PCF8574 o/p pin.

Write 0, and the LED lights.
Write 1, and the LED is off.

Look very closely at your other chips. They should work ok if they are only driving high impedance loads.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh yeah, this current sinking business. I cannot really wrap my head around it (transistor wise).

Anyway, all my other chips drive 47k, which is under the max HIGH current.

But, I also use some as inputs, where I set the pin to high (as per instructions in the datasheet) and short it to ground with switches and rotary encoders. This works, but should I have done that through a resistor?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No. This is the whole point of 'quasi-bidirectional' pins. (Like the 8051 chip)

You write a 1, and the pin is high-impedance. e.g. you can connect a switch to it. Make sure that your switch is between GND and the PCF8574 pin.

I know that it takes a bit of getting used to. But with an AVR, you have DDRx, PORTx, PINx that are all separate registers.
With the quasi, you just need a single register. So your PCF8574 code is a lot simpler.

You still need to change your 47k loads. Wire the 47k between 5V and the pin, the same way that you wire the LEDs. The minimum source current is only 30uA, your 47k load is 106uA, hence out of spec for sourced current.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm, that would require PCB redesign.

The 47k loads are currently fed to a darlington transistor pair. When the port is 1, the transistor turns on, turning on relays. 106µA is below the 300 µA max, so that should work, right?

Also, where I had 10K's I now have 18k resistors. I couldn't go higher because the transistor setup on this PCB is not darlington, and I need to switch 60 mA. With 18k it works, but the draw is 277µA; quite close the the max. Is that going to be a problem?

I will keep this in mind for my future designs, but these PCB's are all done and I don't really feel like remaking them...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As the IO expander cannot source much current (it cannot output high), the best you can do is to have a reasonable value pull-up from transistor base to supply voltage.

Then you can control the transistor on by letting current flow from supply voltage through resistor to transistor base, and turn transistor off by pulling the base low with IO expander.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The 47k loads are currently fed to a darlington transistor pair. When the port is 1, the transistor turns on, turning on relays. 106µA is below the 300 µA max, so that should work, right?

No. The worst case is 30uA. The best possible case is 300uA. Life is much simpler if people quoted their part numbers, and gave some specific figures.

Darlington transistors often have internal base-emitter resistors. They normally have hFE > 5000. So you typically only need 10uA base current for 500mA collector current. i.e. well within the source current available.

Bear in mind that you do need to check that your Darlington saturates else you could get hot.

Regarding non-Darlingtons. You can easily replace with higher hFE devices. A typical small signal switching transistor has an hFE of 300. 30uA base current will 'switch' 9mA collector current. Note that 'switch' is a misnomer because the transistor will not be saturated.

Use the proper external pull-up resistors on your o/p pins. e.g. 220R would switch non-Darlingtons very hard.

David.