PCF8574 Remote 8-bit I/O expander for I2C-bus

jip's picture
Price: 
$1.58 USD

If you're ever in need of additional digital inputs or outputs then this chip may be an answer to your prayers. It only requires two connections from your microcontroller (the I2C bus wires) and it provides you with 8 pins that can be configured individually to be input or output.

What's great about this chip is that if you need even more inputs or outputs you can just add another one of these without the need for extra connections to your microcontroller - I2C rocks! The hardware I2C slave address can be configured to any of 8 different addresses meaning you can have a total of 8 of these chips on the same I2C bus.

Your rating: None
fritsl's picture

Cool!I have some 7.1

Cool!

I have some 7.1 digit-led's, but have never used them as it would take too many outputs, even when som other chips was put in front.

But as  I read it, I can just put one of these in front of every 7.1, and then control a whole row of these with just one out?

Halelulja, old-school-displays, here I come!!

/ Frits 

jka's picture

Use display driversdrivers

You could do that... Or you could get yourself a handfull of 4511 chips. It's a display driver that can convert a 4-bit number to the signals a 7-segment display needs. It has build-in latches to keep digit on the display, even if you turn off or change the input. What you do is:

 Connect the 4-bit input of 4 4511s to bit 0-3. Bit 4-7 is connected to the EL inputs of the 4 chips, one for each input. You then do:

Set the first digit on pin 0-3, set bit 4 low and 5-7 high to turn EL low on the first chip and high on the other three.  This will make the first display show the digit. Then you turn bit 4 high. This will store the digit in the latches of the 4511. Then you select the next digit on bit 0-3, bit 5 low and 4,6,7 high. Then turn bit 5 high to store the second digit on the second display etc. Did this make sense? The bottom line is, that by using some external drivers, you can connect 4 displays to an 8-bit output, instead of just 1. Read about the 4511 here: http://www.doctronics.co.uk/pdf_files/4511.pdf

TheCowGod's picture

That's good to know. I just

That's good to know. I just bought a few of those 4511's to let me drive digital displays, but I didn't realize that I don't even have to send signals to each one all the time. So you need a total of 4 pins + number of displays. That's an improvement, but it still seems like a lot. Still, I guess to get the pin usage even lower, you'd need to have something smarter in between, like that I2C chip.
jip's picture

You only need to connect the

You only need to connect the I2C bus wire pins (SDA and SCL) of your microcontroller to each of the PFC8574 chips corresponding SDA and SCL pins and then you need some pull-up resistors on both the wires (I used 82k resistors for my LEGO compatible sensor).

This means you can control eight LED segments (plus any other I2C hardware not using the same fixed address prefix as the PCF8574) with just two pins on the microcontroller. By combining the segment drivers JKA mentioned with the PCF8574 chips, you can control as much as 32 LED segments so a scrolling effect would be in its place :-).

- Jimmy

TheCowGod's picture

Wow, and this chip is only

Wow, and this chip is only $1.58 from what I'm seeing online. Nice, I'll have to pick some up. Although, looking at the two options they list (PCF8574N and PCF8574AN) I can't tell what the difference is. I'm comparing the datasheets for each, and they're not identical but I don't see functionally how they differ. Any experience with that? Would both versions work equally well for this type of use, or is there one in particular we should choose?

Dan

jip's picture

I know one difference is the

I know one difference is the fixed part of the I2C address and that really tricked me in the beginning since I had bought the other version than the one used in the tutorial I was reading :-). Other than that I don't know of any differences.

The price I listed is from the Danish shop where I normally do my online shopping. I totally forgot to check other online stores. Thanks for the info - I'll update the price right away :-).

By the way NXP (the artist... erh... company formerly known as Philips) makes a lot of cool I2C chips. I know I'm interested in the I2C 4 channel analog to digital converter that also has a digital to analog converter onboard.

- Jimmy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.