Re: Calculating resistors required
From: Peter Bennett (peterbb_at_somewhere.invalid)
Date: 12/31/04
- Next message: Roger Johansson: "Re: 70Mhz FM amplifier circuits.."
- Previous message: Rich Webb: "Re: Transistor Orientation woes ?"
- In reply to: Danny T: "Re: Calculating resistors required"
- Next in thread: Byron A Jeff: "Re: Calculating resistors required"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 31 Dec 2004 11:24:53 -0800
On Fri, 31 Dec 2004 16:30:27 +0000, Danny T <danny@nospam.oops> wrote:
>Anthony Fremont wrote:
>> The goal is to never have an input pin in a "floating" state. They are
>> suggesting that you use a pull-up resistor on the pin so that when the
>> switch isn't closed(pressed), the input pin sees a logic 1 (+5V) via the
>> juice feeding thru the pull-up. Then you have the switch so that it
>> shorts the pin directly to ground when pressed. The pull-up resistor
>> will limit how much current is flowing to ground, and the input pin will
>> "see" a logic 0. This way, the input pin is always connected to a
>> voltage reference of 5V or 0V.
>
>My only question here, is that a switch would then give logic 0. I
>thought it would be reversed, and a 1 would mean the switch is pressed.
>Is that the usual way of doing things?
The tradition of using pull-up resistors and a switch to ground comes
from the characteristics of a TTL logic input. TTL inputs required a
fairly low resistance to ground before they would consider it a logic
low, and if the input was left open-circuit, would normally consider
it a high (but it is still good practice to use pull-up resistors).
CMOS inputs, as on most microcontrollers, don't source or sink any
current - if left unconnected, they will be in an unknown intermediate
state. Since they don't supply any significant current in either
state, you can use a fairly high value of resistor to pull the input
either high or low - then use the switch to pull it in the other
direction.
-- Peter Bennett, VE7CEI peterbb4 (at) interchange.ubc.ca new newsgroup users info : http://vancouver-webpages.com/nnq GPS and NMEA info: http://vancouver-webpages.com/peter Vancouver Power Squadron: http://vancouver.powersquadron.ca
- Next message: Roger Johansson: "Re: 70Mhz FM amplifier circuits.."
- Previous message: Rich Webb: "Re: Transistor Orientation woes ?"
- In reply to: Danny T: "Re: Calculating resistors required"
- Next in thread: Byron A Jeff: "Re: Calculating resistors required"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|