OUT15 = IN14 - should it work?
charlieknox
Posts: 27
I am detecting relative temperature with a voltage divider, half of which is a thermistor.· I'm just using the fact that the stamp input pin (14) transitions from low to high at around 1.45 volts.· I want to drive a transistor switch into saturation (P15)·to energize a relay to turn on a heater.
I am monitoring the input (P14)·and output (P15) with a DEBUG command, and the two go hand-in-hand from 0 to 1 with OUT15 = IN14, but the LED I've got on the output of P15 will not light up when DEBUG says IN14 and OUT15 are both high (1).· The LED works fine across Vss and Vdd, just won't come on when plugged into P15.· Any ideas??· This worked fine a year ago, but as they say, "That was then, this is now".
Thanks!
Charlie
I am monitoring the input (P14)·and output (P15) with a DEBUG command, and the two go hand-in-hand from 0 to 1 with OUT15 = IN14, but the LED I've got on the output of P15 will not light up when DEBUG says IN14 and OUT15 are both high (1).· The LED works fine across Vss and Vdd, just won't come on when plugged into P15.· Any ideas??· This worked fine a year ago, but as they say, "That was then, this is now".
Thanks!
Charlie
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
In the interest of learning more about how the Stamp works, what is the DEBUG window seeing, when it claims OUT15 is a 1?· Is it·1 in one table, but not another?· Or just a half-hearted 1?· Just curious.
On another note, I see the new BS editor has the PIN command, for example CS·· PIN· 3.· In the programming reference (back of Basic Analog & Digital), it tells me this is better than CS·· CON·· 3.· There's got to be more to the story, I'm guessing, in terms of advantage of PIN over CON.
Thank you for your quick response!
Charlie
The nicest thing about the PIN command, other than the fact that it makes more practical sense, is that it will set the assigned pin to INPUT or OUTPUT intelligently, relieving the programmer of remembering to do so. Many of the more sophisticated PBASIC Commands (SERIN, SEROUT, etc) will do that for you on their own, but some of the primatives (HIGH, LOW) do not.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 3/17/2006 10:18:26 PM GMT
Using the PIN definition would not change anything in this program as the comparison and assignment was directly with bits and did not involve any of the functions that require the DIRS bit to be in a specific state.· BTW, HIGH and LOW do in fact set the respective DIRS bit to %1, making the pin an output.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax