PCF8574 interfacing

Discussion specific to the intelligent brick, sensors, motors, and more.
Post Reply
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

PCF8574 interfacing

Post by h-g-t »

I want to add some tactile switches using a PCF8574 to provide input to the NXT.

In the Extreme NXT book, the switches are shown as simply shorting the pins to ground, whereas Sivan Toledo shows a circuit in which the pins are connected to the supply line through resistors which are then shorted out - http://www.tau.ac.il/~stoledo/lego/i2c-8574/

As a complete newbie I am stumped as to the advantages/ disadvantages of each circuit. Does connecting the pins to the power supply mean that you do not have to use a write command to set each pin before reading it, which simplifies the program?

Advice appreciated.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
philoo
Posts: 76
Joined: 29 Sep 2010, 09:04
Location: Paris, France
Contact:

Re: PCF8574 interfacing

Post by philoo »

For most uses, I don't see the point of using external pull-up resistors. PFC8574 is explicitely designed to provide internal pull-up, so external resistors would be needed only if for some reason you want to have more current flowing in the switch. And programminig is exactly the same anyway.
Philo
h-g-t
Posts: 552
Joined: 07 Jan 2011, 08:59
Location: Albania

Re: PCF8574 interfacing

Post by h-g-t »

Thanks Philo, I'll keep it simple and just short the pins.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: PCF8574 interfacing

Post by mattallen37 »

You probably already know this, but I'll say it just to be sure.

The PCF8574 is not able to source current, it is only able to sink. It does have internal pullups, so to use a touch sensor, you must write the pins high, and then read them looking for a low.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests