Serouting via a Darlington
Newzed
Posts: 2,503
I'm working on a new circuit which I would like to make very flexible.
Suppose Stamp Pin 0 was connected to Pin 1 of a ULN 2003 which hade a supply of 5VDC.· If I take Stamp Pin 0 high, Pin 16 of the 2003 will go low and turn on a 5 volt relay.· That's SOP for the 2003.
Now suppose I wrote:
serout 0, baud, [noparse][[/noparse]byte]· instead of just taking Pin 0 high.· Would byte appear on Pin 16 of the 2003 in an inverted form?· I know I could just try it and find out but I would hate to burn out a Stamp pin in case I have overlooked something.
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
Suppose Stamp Pin 0 was connected to Pin 1 of a ULN 2003 which hade a supply of 5VDC.· If I take Stamp Pin 0 high, Pin 16 of the 2003 will go low and turn on a 5 volt relay.· That's SOP for the 2003.
Now suppose I wrote:
serout 0, baud, [noparse][[/noparse]byte]· instead of just taking Pin 0 high.· Would byte appear on Pin 16 of the 2003 in an inverted form?· I know I could just try it and find out but I would hate to burn out a Stamp pin in case I have overlooked something.
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
Comments
Having said that, if you're concerned, you can put a 220 ohm resistor between the BS2 pin and the Darlington -- that will protect the BS2 from most things.
Note also when the Darlington 'de-energizes' the relay, the collapsing magnetic field in the coil will generate a reverse current. This reverse current can burn out the Darlington pin, unless shunted with a diode (which I believe some Darlington devices have internally, so this may not be an issue for you).
·· In theory I would say it might work...But you would need a pull-up resistor on the output since it should be equivalent to an open-collector output.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Not only will the data from "byte" appear there, but so will the start and stop bits which may well cause all sorts of chatter, which it the last thing you want to see when driving a relay. The parity bit will also appear there, if it is specified.
Last - if you just want the data to be inverted, you would need to specifiy inverted in "baud". If the whole point of this is just to provide an "opposite" (inverted) signal, just throw a not (~) in front of your output command parameter.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
·· I am going on the assumption you are not using this with a relay, since you asked about coming directly out of the pin on the ULN.· I guess the only thing to do would be to try it.· Electrically the ULN is a Darlington transistor and as such should act like one, inverting the output.· If you don't connect the V+ terminal on the ULN to anything you shouldn't have any issues with the internal diodes as they will be disconnected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·