Shop OBEX P1 Docs P2 Docs Learn Events
XON/XOFF support in FullDuplexSerial? — Parallax Forums

XON/XOFF support in FullDuplexSerial?

RobotWorkshopRobotWorkshop Posts: 2,307
edited 2010-08-20 11:14 in Propeller 1
I haven't seen this mentioned before and wanted to see if anyone has an example of using the FullDuplexSerial or Extended_FDSerial that uses XON/XOFF for handshaking. It is rare that I've had to use that but I have one device that uses it that I want to connect to the Propeller.

Robert

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-19 07:22
    FullDuplexSerial doesn't support XON/XOFF flow control. There's one or two serial drivers that can be configured to use hardware flow control (RTS/CTS), but I don't thing there is any that uses XON/XOFF.

    If high speeds (> 19.2KBps) are not needed, it should be very easy to write your own routines in Spin using one or two cogs for buffered I/O (either just receive or receive and transmit). Simple_Serial would be a good starting point.
  • JonathanJonathan Posts: 1,023
    edited 2010-08-19 07:26
    Which serial objects supports CTS/RTS ? I've looked and didn't find any that do.

    Jonathan
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-19 07:29
    Thanks for the clarification Mike. I didn't see any support for it in there but thought it would be good to ask before writing something to add support in case someone had already done it.

    I just need to use 9600, 8, N, 1 so speed isn't an issue.

    If anyone happens to have a serial object with XON/XOFF already written, please speak up, otherwise I have some extra coding to do...
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-19 07:41
    The Multiple Serial Port Driver supports hardware flow control.
  • LeonLeon Posts: 7,620
    edited 2010-08-19 07:48
    The OP might need circular buffers. Systems using XON and XOFF often transmit a few characters after receiving XOFF, and they can be missed without a suitable buffer. That caught me out many years ago when I was downloading a very large file from a mainframe.
  • JonathanJonathan Posts: 1,023
    edited 2010-08-19 11:13
    Mike Green wrote: »
    The Multiple Serial Port Driver supports hardware flow control.

    Thanks Mike! I'll try that one out.

    Jonathan

    PS Sorry for the thread hijack
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-19 12:03
    In case someone isn't familiar with the XON/XOFF protocol here is a good Wiki page describing it:

    http://en.wikipedia.org/wiki/Software_flow_control

    http://www.lammertbies.nl/comm/info/RS-232_flow_control.html

    The device doesn't send too much data back so I mainly need to watch for it so I don't overflow it's buffer.

    Robert
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2010-08-20 11:14
    Thanks Mike Green. I had some distant memory of there being a serial port driver that did a lot of ports in one COG but forgot the name and looked at FullDuplexSerial and said, 'oh well', because I'm working on a project with limited free cogs and was hogging up two just for 2 instances of fullduplexserial. Thanks for the reminder!
Sign In or Register to comment.