Serial port simplex driver

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,843
edited 2006-04-14 - 03:06:58 in Propeller 1
Here's a simple serial driver (simplex.spin) I've been using for some debug stuff. Unlike FullDuplex.spin, it doesn't require its own cog. But be aware: it's output only. Nonetheless, I've made it compatible with FullDuplex so it can be used as a drop-in replacement for those instances where input is not necessary. Also, there's a provision to invert the output for direct connection to an RS232 port.

-Phil

Comments

  • Martin HebelMartin Hebel Posts: 1,231
    edited 2006-03-20 - 23:26:16
    Looks like you are keeping busy Phil! I especially like your stack monitor [noparse]:)[/noparse]

    I'll point out my BS2 Library, posted earlier, also contains Half-Duplex serial functions, also allowing inverted output and in Spin, so it allows send and receive, though no timeout on receive. It supports string, hex, binary, decimal and character modes, either using the DEBUG function set or the SEROUT set.

    Was 9600 about the best you could push? With the delays in Spin, that was the upper limit I saw also.

    -Martin
  • Martin HebelMartin Hebel Posts: 1,231
    edited 2006-03-20 - 23:27:17
    Sorry, just now noticed we are in the propeller group, and I only posted the finished code in the Beta group. I'll post now.

    -Martin
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,843
    edited 2006-03-21 - 00:05:53
    Hi Martin,

    Yeah, it chokes up at 19.2K -- even lacking the receive capability. But 9600 is really all I need for debugging.

    Looks like you've been busy, too!

    -P.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-14 - 03:06:58
    I liked how you handled Inverted baud mode, Phil, so I created a version that supports tx and rx.· It seems to work fine up to 19.2 in both True and Inverted modes (used a BS2 and tester).· Thanks again for providing foundation code for another nice object.

    [noparse][[/noparse]Update] Changed start method so you can use just tx or just rx if that is all that is required.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 4/14/2006 5:23:32 PM GMT
Sign In or Register to comment.