Shop OBEX P1 Docs P2 Docs Learn Events
How do you make a dip switch either GND or VCC, but not floating? — Parallax Forums

How do you make a dip switch either GND or VCC, but not floating?

Kaos KiddKaos Kidd Posts: 614
edited 2006-07-24 20:11 in Propeller 1
I need a dip switch that sets either a High (VCC) or GND when in either of it's states.
From what I can tell, it's simple to from VCC through·the dip to the chip input.
When the dip is on, the pin is at VCC, high.· When the Dip is off, the pin is left floating, not at gound.
Is it a simple matter of a reistor tied through the out side of the dip (the side that goes to the chip) to ground?


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd

·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-07-24 19:45
    KK,

    Yes, a pullup (or pulldown) resistor ~10K will do the job.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-24 19:46
    Yes, tie a resistor (4.7K or 10K, something like that) between the Propellor pin and ground, then the same size resistor to 5V (yes) from the "far" side of the DIP switch. That gives you a near ground potential when the switch is open and about 2.5V when the switch is closed. You could tie the resistor to 3.3V if you have to, but that gives you 1.65V at the Propellor pin. If you really want to use 3.3V, I'd use 10K to ground, but only 4.7K to 3.3V. That way, you'd have about 2.2V at the Propellor pin when the switch is closed.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-07-24 19:53
    YOu guys are awesom...
    THis is the same concept as the sda and scl lines on the demo board, isn't it? The resistor forces it to see ground or vcc, not floating potententally between...
    Dudes, a good old 50 watt light just wen off somewhere... Oooph, but it's blinding me...
    Pullup / down... now it makes...
    as quoted else where "weakly pulled down", would mean a lesser resistor going to ground, right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd

    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-24 20:11
    Actually, weakly pulled down refers either a high value resistor or some kind of active circuit that accomplishes the same kind of thing (usually what's called a current source/sink).
Sign In or Register to comment.