Bit banging Asynchronous Serial Communication
On Thu, 11 Jan 2001 07:55:19 +0100, you wrote:
Either will work. Edge-detection will be more susceptible to noise,
but this won't be a problem for most apps. Edge detect is also the
only option for very high baudrates, where you can't get a
sufficiently high sample rate for polling. Edge-det also uses no CPU
time until data comes along.
Polling has the advantage of only needing one interrupt source, which
can be shared with other timer int functions.
As with most of these things, there is no 'best' way - it depends on
>> 2) Once you think the start byte is coming, what is the best way to be
>> sure. ie, do you look for a pulse that is equal to 1/baud rate? or do you
>> assume that any transition is the beginning of the Start Byte?
Depends on how much noise you expect. You should allow margins for
baud errors, so if you do check the length, check for at least, say,
0.5 or 0.75/baudrate. An easy way is to have a timer int at
baudrate*2, and check for startbit on 2 successive ints.
http://www.piclist.com hint: To leave the PICList
In reply to: <Pine.LNX.firstname.lastname@example.org>
See also: www.piclist.com/techref/io/serials.htm?key=serial
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the