Data Storage Tool Display Human Input Protocol Math Motor Control Sensor Signal Generation & Processing Speech & Sound Fun View all Objects


Quick Links
Contact Us
Forums
Support

Register
Login

This object is provided under license. By downloading this object, you are agreeing to the terms of the MIT License.

Simple Serial

Bit-bang serial driver for low baud rate (~19.2K) devices.
* This driver is designed to be method-compatible with the FullDuplex serial object, allowing it to be used when high speed comms or devoting an independent cog for serial I/O is not necessary.
* Bi-directional communication on the same pin is also supported.

v1.3 - May 7, 2009 - Updated to fix rx method bug where uninitialized variable would mangle received byte.

Version:
  1.3

Attributes:


Author:
  Chip Gracey (Parallax)

Categories:
  Protocol

Downloads:
  2,563

Last Updated:
  2009-05-15



User Reviews:

  • Michael Green commented:
    [Version 1.2] has a bug in the RX routine where the variable "b" is not initialized before use. To fix the bug, put a "b~" statement somewhere before the REPEAT loop.
    September 26, 2008 9:14 a.m.


  • StefanL39 commented:
    My recomendation is to use the FullDuplexSerial-object and NOT simple_serial ! ----------------------------------------------- My Opinion about the simple_serial-object is: it is simple CODED but difficult to USE because of several limitations. ---- That's a quite hard judgement, but: - it is NOT possible to send and receive at the SAME time ----- - multiple byte-receiving is difficult: ---- - if you want to receive multiple bytes you can do nothing inbetween the receiving of the multiple bytes. ---- If you do something else inbetween there is a high danger that data gets partially lost ----- - if you use a loop that does check periodically for imcoming bytes, - inside this loop can be done not much more than that checking. ---- Otherwise there is the danger that data gets partially lost -------- - limited to a baudrate of 19200 baud -------------------------------------------------------------- Only in the case that you are running out of cogs (CoProcessors) it might be an option to use simple_serial as it does not need a cog for its own. --------------------------------------------------------------- My recomendation is to use the FullDuplexSerial-object This object needs a cog on its own but then you can - send and receive at the SAME time - receive up to 16 bytes in the background while your application does other things inclusive sending bytes - use higher baudrates up to 115200 baud. ------------------------------------------ Another tip is to take a look into the Extended_FullDuplexSerial-object it uses the FullDuplexSerial-object and adds methods to send and receive numbers and strings with and without timeouts regards Stefan
    May 26, 2008 4:04 p.m.




  • Copyright 2007 by Parallax, Inc.
    Please contact obex.support@parallax.com with comments or questions.