Shop OBEX P1 Docs P2 Docs Learn Events
Serial IO & SX — Parallax Forums

Serial IO & SX

jb1311jb1311 Posts: 20
edited 2005-12-06 16:42 in General Discussion
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?

Comments

  • BeanBean Posts: 8,129
    edited 2005-12-05 22:57
    Is the SX sending or receiving or both ?
    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.
    ·
  • jb1311jb1311 Posts: 20
    edited 2005-12-05 23:01
    I just want it to send. I've been looking for a circuit using transistors, but all I can find are examples with a MAX232 IC. Of course I don't one of those handy.
  • BeanBean Posts: 8,129
    edited 2005-12-05 23:06
    Okay sending is a bit more difficult.
    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
  • jb1311jb1311 Posts: 20
    edited 2005-12-06 15:55
    Thanks Bean.

    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.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-12-06 16:42
    You might consider just using the traditonal RS-232 driver chips if you have the +/- 12 volts supply.
    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
Sign In or Register to comment.