View Full Version : voltage values

01-28-2010, 11:25 PM
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
y = 0

01-28-2010, 11:34 PM
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'.

01-28-2010, 11:50 PM
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.

01-29-2010, 12:34 AM
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)

01-29-2010, 12:35 AM
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.


01-29-2010, 12:41 AM
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


Tom Sisk


Post Edited (stamptrol) : 1/28/2010 5:46:23 PM GMT

02-01-2010, 12:15 AM
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 ?

02-01-2010, 01:53 AM
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