UART interface
teganburns
Posts: 134
I have a few new toys that interface via UART connection. One being the ls_uart_wifi module.
http://www.google.com/url?sa=t&source=web&cd=1&ved=0CDUQFjAA&url=http%3A%2F%2Fwww.linksprite.com%2Fpub%2FLinkSprite-UART-WiFi.pdf&ei=1Yu0UPaHGq2ByAH9nYDoDQ&usg=AFQjCNEgB3fQIqAR6nOXspemfZpzafywDA
If anyone could write some example code to help me get started with interfacing UART devices that would be great!
http://www.google.com/url?sa=t&source=web&cd=1&ved=0CDUQFjAA&url=http%3A%2F%2Fwww.linksprite.com%2Fpub%2FLinkSprite-UART-WiFi.pdf&ei=1Yu0UPaHGq2ByAH9nYDoDQ&usg=AFQjCNEgB3fQIqAR6nOXspemfZpzafywDA
If anyone could write some example code to help me get started with interfacing UART devices that would be great!
Comments
Here you'll find some examples of how to use the FullDuplexSerial or the SimpleSerial in
Propeller <-> PC Terminal Communication·-·Updated·(1/25/09)
or Debug LITE for the Parallax Serial Terminal
(UART = Universal Asynchronous Receiver Transmitter)
The serial interface is one kind of an UART which of course can come along in several flavours:
You can have a serial interface via USB, you can have RS232, but most common in chip to chip communication is just connect an Rx Tx pair of one device with the Tx Rx pair of another device maybe with some level shifting if one device is 5V and the other is 3.3V.
So, the mentioned link should give you an overview of how to program with the SimpleSerial or the FullDuplexSerial objects. The rest is on reading specs of your wifi - module. What does the protocol look like, which commands do exist and so on ...
So, basically FDS has functions like
rx for receiving a byte (blocking)
tx for sending a byte
str for sending a whole string
dec for sending a number in decimal string representation
hex for sending a number in hexadecimal string representation
rxcheck to check whether a byte is available
rxtime for receiving a byte but only blocks for a certain time
The biggest difference from my point of view is, that SimpleSerial is written in SPIN and has a speed-limit (I think it works up to 19200baud/s). The FDS is written in PASM.
I think in the obex there are other serial interface objects which added some functionality to the basics, so you might want to check whether some of those can save you some coding-time. (use the Summary view)
I never used something else so far.