Bit banged vs UART

Questions on UARTs, and serial communication
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Bit banged vs UART

Post by YahooArchive »

>from the help line

>I basically need the board to always be waiting for commands from the computer
and then once it processes the command, the board returns back a string through
the serial port.

>< code below >

>what exactly am I doing wrong?

The bit-banged serial routines will only look for serial input when that routine
is running. In some cases you can either loop waiting for that input, in which
case your program will not be doing anything else. Sometimes you can coordinate
that by handshaking with the target device (your program then would control when
the serial input happens).

Or switch to use one of the UARTs which is hardware that will receive the serial
stream, and has interrupt driven software in the firmware that will buffer up to
256 bytes. So as long as your program can keep up with that it will work.


--------------------

I tried:
DIM BAUD16(9600)
DIM command(5) as STRING
SERINtimeout = 500000


SERIN(16,9600,0,command)
SELECT VAL (command)
CASE ....
DIM out(5) as STRING
SEROUT(16,9600,0, out)



Post Reply