Interfacing RS232 devices
Eric Adams
Posts: 11
Got a question concerning the input to the stamp from a RS232 (+12/-12) devices.· When I want the stamp to monitor an incomming RS232 signal from a device such as a·DCE from a peripheral what do I have to do to get this +12/-12 volt signal from destroying the stamps input pin.· The stamp cannot take this voltage so there has to be a way to protect the input pin. Any ideas will be greatly appreciated.
Thanks
Thanks
Comments
If you go through the Pbasic help file (hint hint) under serin/serout, I believe they have circuit examples indicating the resistor on the incoming rs232 line.
The outgoing line doesn't need the resistor...but not it only outputs TTL level logic; HOWEVER, this is almost enough on the majority of systems....But you may need a MAX232 type chip to convert TTL to rs232 levels.
If you are running wires through questionable domains....you might want to optically isolate your stamp. Just a thought!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://ca.geocities.com/steve.brady@rogers.com/index.html
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Now the protection diodes can only conduct a certain amount of current -- thus the 22 Kohm resistor drops the current enough so that the protection diodes can operate happily.
Note the physical pins 1 through 4 on the BS2 have a transistor-based RS-232 reciever-driver on them. The TX signal from the PC is used to provide the voltage for the 'RX' signal coming back. You can use this port with the SEROUT 16, 84+16384, [noparse][[/noparse]"Hi"] keyword. Note it is using the 'pseudo' port 16 -- which tells the BS2 to use the built-in programming port on pins 1..4.
If you want more serial ports than that, a MAX232 chip will allow you to 'send' +-12 volt signals. But if all you want to do is recieve, the 22 Kohm resistor approach works well.