Shop OBEX P1 Docs P2 Docs Learn Events
Help with RS-232 Interface to PC — Parallax Forums

Help with RS-232 Interface to PC

mynet43mynet43 Posts: 644
edited 2011-06-05 16:23 in Propeller 1
I'm designing a Propeller board to interface to a standard PC, using a DB-9 connector.

If possible, would someone please provide sample wiring and setup code for communicating at 57600 baud?

I will probably be using pcFullDulpexSerial4FC as the driver, although any recommended driver is OK, as I'm probably only using a single port. I'm familiar with the program, just not the wiring and setup.

It's not clear to me whether I can ignore things like the CTS and RTS lines.

Thank you for your help.

Jim

Comments

  • LeonLeon Posts: 7,620
    edited 2011-06-04 10:30
    You need a driver like the MAX3232 between the Propeller and the PC.

    Don't bother with handshaking, it isn't used much these days. If you are sending a lot of data, use circular buffers with XON/XOFF flow control instead of hardware handshaking, and CRC error correction.
  • mynet43mynet43 Posts: 644
    edited 2011-06-04 10:46
    Thanks Leon,

    That helps.

    Also, when using a DB-9, do I connect TX to pin 1 and RX to pin 2 from the MAX chip, or is it reversed?

    And, is it possible to use the Prop Plug pins to drive the MAX chip? I'm running out of pins.

    Jim
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-04 11:47
    sure you can use pin 30,31 for serial communication as any other IO-pin.
    that's what Parallax serial terminal, PropTerminal, ViewPort does all the time.
    best regards

    Stefan
  • waltsailingwaltsailing Posts: 40
    edited 2011-06-05 08:29
    Hi,
    You can do what you describe, but if you already have a USB cable hooked up to download your program, it is pretty easy to use this, almost seamless as the interface. The serial debug output works great at 115200 baud. You just load in the right object and then you call the routines and it spits the data into the PC. You can view it in the Parallax serial terminal, and then if you want to get it into your own programs, such as in VBexpress it is really very easy to do. The first trick is to get the serial debug object into your code and have it write strings out. See the programming in spin book for an example. You then run the serial terminal and it should display the data. If you can download your program this will work almost first time. You can jump between the propeller tool and the serial debugger and VBexpress custom programs easily without unhooking cables.

    Walt,
  • kwinnkwinn Posts: 8,697
    edited 2011-06-05 08:57
    @mynet43, IIRC someone on the forum is selling a small adapter card/DB9 connector combo to do exactly what you require. It looked very professional and the price was reasonable.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-06-05 16:23
    Digilent www.digilentinc.com has a module that does this and quite cheaply. There is a schematic also. It is not hard to make the cable that is supplied with this connect to the propplug connector on your pcb.

    FullDuplexSerial will work for you. I have a modified version on the obex that extends the buffers above 16 bytes.
Sign In or Register to comment.