Serial port simplex driver
![Phil Pilgrim (PhiPi)](https://forums.parallax.com/uploads/userpics/612/nMG83RHE7MV61.gif)
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
-Phil
spin
![](/plugins/FileUpload/images/file.png)
2K
Comments
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
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.
[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