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.
PCF8574 interfacing
PCF8574 interfacing
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.
Re: PCF8574 interfacing
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
Re: PCF8574 interfacing
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.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: PCF8574 interfacing
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.
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
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Who is online
Users browsing this forum: No registered users and 0 guests