Shop OBEX P1 Docs P2 Docs Learn Events
Customize Serial Driver — Parallax Forums

Customize Serial Driver

KyeKye Posts: 2,200
edited 2014-02-24 13:24 in Propeller 1
I need to be able to force the TX line low for periods of 100 ms to generate line break conditions for the PC. How should I do this?

I know how to do this in SPIN, since I can control the life time of the serial cog... but, how would I go about it in C?

Comments

  • ersmithersmith Posts: 6,054
    edited 2014-02-24 08:24
    Kye wrote: »
    I need to be able to force the TX line low for periods of 100 ms to generate line break conditions for the PC. How should I do this?

    I know how to do this in SPIN, since I can control the life time of the serial cog... but, how would I go about it in C?

    It depends on which serial driver you're using. If you're using SimpleSerial then it's very easy -- the serial code is running on the same COG as the C code, so you can just force the pin low yourself. For FullDuplexSerial it's a bit trickier. One way would be to close all the file handles associated with the serial device -- this will cause the COG to be stopped. It will be re-started when you re-open the files.

    Eric
  • KyeKye Posts: 2,200
    edited 2014-02-24 13:24
    Thank you,
Sign In or Register to comment.