Serial IO & SX
jb1311
Posts: 20
Can I connect the SX directly to a PC COM port?
I only want to test my program @ 2400 Baud and short < 5 ft. Is there a discrete circuit equivalent that will level shift the input/output?
I only want to test my program @ 2400 Baud and short < 5 ft. Is there a discrete circuit equivalent that will level shift the input/output?
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
·
Sometimes you can just connect the SX pin the serial pin (I would use a 220 Ohms resistor just in case) and it will work.
It really depends on the serial hardware on the PC. If it doesn't work, then you need to level shift. Look at the schematic for the BS2. You will see how they use the -12V level on a different serial pin to create a serial signal that goes from -12V to +5V. I think it's just a transistor and a couple resistors.
[noparse][[/noparse]EDIT:]
Ah yes look here: http://www.parallax.com/dl/docs/prod/schem/bs2revf.pdf
See that they have a 4.7K resistor from Sin to Sout. That because Sin is at -12V when it's idle (that's output FROM the PC serial port). Then they use a transistor to switch it to +5V with the single PNP transistor pack (top right).
P.S. That 4.7K resistor is also why the stamp echos everything back to the PC. The stamp isn't doing anything, but because the input is tied to the output it gets looped back to the PC.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
Post Edited (Bean (Hitt Consulting)) : 12/5/2005 11:16:06 PM GMT
I got it to work last night. I put a small delay between sent characters, without it the sent message was scrambled. I suppose it may because I'm not using any handshaking.
I think it is a SN75196. Must faster and less thought that looking at transistor leads.
Otherwise, the MAX232 is your friend at it only requires the +5.
Once you build the circuit on a breadboard, you can consider creating an standard adapter [noparse][[/noparse]which includes the DB-9 and the configured set up]for any future projects.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan