Shop OBEX P1 Docs P2 Docs Learn Events
Reading a PC Serial port — Parallax Forums

Reading a PC Serial port

AmitAmit Posts: 27
edited 2006-12-07 12:59 in General Discussion
I have my SX48 writing to my PC's serial port at a baud rate of 57600 (SerOut Tx, T57600, temp). I was under the impression that this could be easily read by a computer running XP. I have tried reading the port using hyperterminal and the command prompt but to no avail. The data are all byte integer values 0-255 and there are 8092 of them. Can anyone recommend an easy way of reading this input? More generally does anyone use any particular application that allows for simple read/write to a PC com port? I'm used to the debug window that the stamps had and now feel dumb for not thinking further ahead. Any help would be greatly appreciated.

Best,
Amit

Comments

  • PJMontyPJMonty Posts: 983
    edited 2006-12-07 02:19
    Amit,

    Go here:

    sourceforge.net/projects/realterm/
      Thanks, PeterM
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-12-07 02:22
    The SX inputs & outputs TTL/CMOS, basically 0 and +5V, but the computer's RS-232 is looking for voltage swings between -12V and +12V.· So, you need to add a "level-shifter" to interface/convert the two; a MAX-232.

    ** Post Edit **· Another thing --·Hyperterminal can only make sense of ASCII.· It's not a hex terminal.· It's expecting, strictly, values corresponding to letters and numbers in the ASCII fomat.· You can't send it hex data of·0 - 255 and expect to see as a result hex data (i.e. sending $FF won't result in $FF on the PC/Hyperterm, it'll ignore that.)· There are programs that will accept all values as data, but Hyperterm ain't it.· Look for STGold, it's available as a limited-time demo-ware.

    Post Edited (PJ Allen) : 12/7/2006 2:31:03 AM GMT
  • VonSzarvasVonSzarvas Posts: 3,525
    edited 2006-12-07 12:59
    Amit,
    I had this issue recently... try changing the baud to N57600. My project uses that and works perfectly. I can read bytes on the pc (a quick way to test is capture the text in hyperterminal - cause the hyperterminal display is ascii, then check the captured file with a hex viewer)

    Also, you could output the data in decimal or ascii. On the parallax site & forum are routines to convert bytes to ASCII or DEC. TX_DEC3, TX_HEX.. something like that...

    You may need an MX232 in your project, but finally I didn't. Just an SX and 2 pull-up resistors was enough to interface between 2 57600 devices (streaming data in / out) .. also a 50mhz resonator of course!

    Might help... Max.
Sign In or Register to comment.