Shop OBEX P1 Docs P2 Docs Learn Events
Pins pulled HIGH instead of LOW (I made a mistake) oops. — Parallax Forums

Pins pulled HIGH instead of LOW (I made a mistake) oops.

RonPRonP Posts: 384
edited 2011-07-26 14:58 in Propeller 1
I made a mistake on my PCB. I thought I was duplicating the example in PEK but I pulled the pins HIGH instead of LOW (newbie confusion). I have a DIP switch with two switches that I want to read first thing in my program and depending on their position have four different modes of operation.

I haven't populated this section of the board yet and want to test my mistake on a bread board first. But before I smoke something thought I would ask. Since the Propeller is sharing a common ground with 5v and 7.4v. Below is a schematic of what I did (A) and what I meant to do (B).

My thoughts are that everything is fine and it should work but, I am afraid of frying a Propeller with 7.4 volts. When in doubt take the safe course, at least that's what they tell me.

HighLowPinsBoard.jpg
HighLowPins2.jpg


Thanks in advance.

Ron
1024 x 1371 - 204K
405 x 259 - 20K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-07-26 13:20
    I don't see a problem there. The switches are pulled up to Vdd and will read high when open, low when closed. (This is actually the way most people wire switches, BTW.)

    -Phil
  • RonPRonP Posts: 384
    edited 2011-07-26 13:22
    Thanks Phil, I was also wondering what the preferred method might be.

    Ron
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-07-26 14:19
    if you want even more security you could add current-limiting resistors of 330 Ohms between switches and prop-IO-pin.

    +3.3V---switch----330---Ohms----X
    10000 Ohms---GND

    prop-io-pin is connected at X

    If your code does accidently configure the prop-IO-pin as output and switch to state low, the current flowing from +3.3V into the prop-io-pin will be limited to
    a save value of 3.3V / 330 Ohms = 10 mA.

    Adding these current-limiting resistors will form a voltage-divider where the prop-IO-pins are connected to the middle-point. This means the prop-IO-pin does no longer "see" 3.3V but

    3.3V - 3.3V ( 10000 ohm + 330 ohm) * 330 Ohm = 3.19 V. This value is still high above the threshold voltage of 1.65V. So the prop-IO-pin still "sees" a clear high-signal.

    keep the questions coming
    best regards

    Stefan
  • RonPRonP Posts: 384
    edited 2011-07-26 14:58
    Thanks Stefan, for the detailed explanation. I wish I would have asked about this before etching the PCB O'well. I will look closer at my PCB and see if I can squeeze this voltage divider "security" circuit in there some how. I have read about and used a couple voltage dividers, but I don't always see how other basic circuits can help me in my own, well mostly copied circuits. Point well absorbed.

    Ron
Sign In or Register to comment.