Shop OBEX P1 Docs P2 Docs Learn Events
poor man's serial I/O — Parallax Forums

poor man's serial I/O

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2007-02-15 17:10 in General Discussion
Would the following work without damaging the sx chip?
VCC=5V

tx pin o
+---- RS232 serial out (-10V/+5V)
················· ·|
············· ··[noparse][[/noparse]4.7k]
··············· ·· |
rx pin o---[noparse][[/noparse]22k]---+---- RS232 serial in (-10V/+10V)


The tx pin is input for -10V·serial output
The tx pin is·high output for·+5V serial output
(eg. tx pin switches between input and high output)

Or should I increase the 4.7k?
This is for a half duplex connection where sx initiates communication.

regards peter

Post Edited (Peter Verkaik) : 2/13/2007 11:27:32 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2007-02-14 04:20
    Peter,
    The protection diodes in the SX will not allow the RS232 serial out to reach -10V.
    About -0.7V is as low as it will go.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-02-14 17:14
    You can dump the 4.7K. The 22K in the recieve line limits the current into the SX so you're set. I've done this exact thing more than once, one time in a [noparse][[/noparse]very low volume] commercial product. Just keep the serial cable short.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-15 10:57
    I added a transistor to transmit.
    See attached schematic.
    With the given resistor values, I did not have a hardware echo when
    sending data from pc to sx28.
    I used a usb2ser cable for the pc com port.
    Also attached my test program.

    regards peter


    Post Edited (Peter Verkaik) : 2/15/2007 11:16:45 AM GMT
  • BeanBean Posts: 8,129
    edited 2007-02-15 16:03
    Peter,
    I'm surprised the "INTERRUPT 1000" didn't mess-up your timing. Maybe because it's an empty interrupt routine. But I'm sure it slowed it down somewhat.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-15 16:58
    Bean,
    I created the SX/B file using another file as framework. I just cleared the interrupt routine
    and didn't give it any thought. I have removed the interrupt routine·and also tried hyperterminal.
    Hyperterminal·does not receive chars correctly. At 1200 baud, no parity, 8 databits, no handshake,
    I receive graphic symbols. When using the basic stamp debug window,·using the same comport
    after closing hyperterminal, I receive all uppercase letters when I·type lowercase letters, as it should.
    Looks like my hyperterminal timing is a bit off.
    Any thoughts why I don't see·a hardware echo?·I really expected that due to
    the 4k7 resistor between TXOUT and RXIN. And before you ask, the "echo off" option
    in the basic stamp debug window is unchecked.

    Edit: just found out why hyperterminal received corrupted chars.
    When I enable the RTS line, then I also receive corrupted chars using
    basic stamp debug window and another terminal program called serialsniffer.
    Turning off RTS solved that issue. Unfortunately, hyperterminal simply enables
    RTS when connecting and you cannot turn it off.
    I suspect my cable is the real cause for this behaviour.

    regards peter


    Post Edited (Peter Verkaik) : 2/15/2007 5:09:37 PM GMT
  • BeanBean Posts: 8,129
    edited 2007-02-15 17:05
    Peter,
    I've had problems with hyperterminal at 4800 baud too. 2400 baud seems to works fine, but for me 4800 baud did not work.
    If the stamp debug window works, then that means it's working. Don't trust hyperterminal.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-15 17:10
    Bean,
    I just edited my prevoius post.
    You are right, hyperterminal is not to be trusted.

    regards peter
Sign In or Register to comment.