Shop OBEX P1 Docs P2 Docs Learn Events
voltage values — Parallax Forums

voltage values

niconico Posts: 28
edited 2010-01-31 18:53 in BASIC Stamp
hi,
from the below code, it is said that if i supply a 5v to pin 0, the value y will be 1. if it is a 0v·y will be a 0. However, what if I have a 2v?
Will y be 0 ? What is the range of the volts to make the value y to be 0?

x pin 0
 
y var word
 
IF x = 1 THEN
y = 1
ELSE
y = 0
ENDIF

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-28 16:34
    Welcome to TTL signaling levels. Or in this case, CMOS signalling levels.

    With classic TTL circuitry (like a 74LS04 inverter chip), 0 to 1.4 volts would be a 'hard' zero, while 2.4 to 5 volts would be a 'hard' one, and anything in the middle is "don't go there", like dividing by zero the result is "undefined".

    The BS2 is CMOS based, but I think above 2.4 it's guaranteed to see a 'one'.
  • niconico Posts: 28
    edited 2010-01-28 16:50
    any suggestion to make the 2volts to be 0volts ? this is because i'm sending signals from my bs to another bs by connecting those bs together. the suppose to be 0volts signal becomes somewhere around 2volts.
  • niconico Posts: 28
    edited 2010-01-28 17:34
    oh i can't ground it because it's readings (which means it is a values that will vary from either a high or low)
  • WolfbrotherWolfbrother Posts: 129
    edited 2010-01-28 17:35
    Hi Nico,

    You may want to use a pull-down or a pull up resistor to force your levels to be what you want them to be, there's some info in the What's a Microcontroller book online that shows this.

    ·http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Wamv2_2.pdf
  • stamptrolstamptrol Posts: 1,731
    edited 2010-01-28 17:41
    First, make sure there is about 220 ohm resistor between the two pins of the Stamps. That will protect the Stamps if one Stamp gets set to 0 volts when the the other is set to 5 volts output.

    Then, put a 10K resistor from one (the receiving one) Stamp pin to ground to "pull-down" the signal when the sending Stamp is trying to hold the line at 0 volts.

    Don't forget that the 0 volts of both Stamps have to be tied together.


    ········································· 220
    Stamp1 pin
    /\/\/\/\
    Stamp2 pin
    ···················································································· |
    ····················································································· \
    ····················································································· / 10K
    ····················································································· \
    ····················································································· /
    ···················································································· |
    ··
    0 volts

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com


    Post Edited (stamptrol) : 1/28/2010 5:46:23 PM GMT
  • niconico Posts: 28
    edited 2010-01-31 17:15
    hi stamptrol and wolfbrother,
    By doing that won't the current will always flows to the ground. so no matter what happen stamp2 pin will be reading a 0v ? This is because my stamp1 is to send values either a 1 or a 0 (a 5v or 0v) to my stamp2 to read. But by doing this, won't it means i will be getting my the stamp2 to read a 0 all along ?
  • stamptrolstamptrol Posts: 1,731
    edited 2010-01-31 18:53
    No. When Stamp1 pin is high, it will raise Stamp2 pin to 5 volts because it can source enough current to feed both the 10K and the Stamp2 internal circuitry.

    When Stamp1 pin is low, the 10K helps "pulldown" Stamp2 pin so it is seen as a 0.

    It'll take 5 minutes to try!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
Sign In or Register to comment.