Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: question about serial port bit banging

2005-12-28 by Zack Widup

Microchip has an application note on serial comm that even gives routines 
for the timing and formulas to calculate the values used in the timers.  I 
forget which one it is but I have it around somewhere.  I've used it 
successfully with PIC16C54, 16F84 and 16F876.

The only problem is that the timing uses simple one-loop counters.  For 
higher frequency crystals you would need to go to nested loop counters or 
much faster baud rates.  9600 baud is difficult to implement with an AVR 
running at 16 MHz.  Not impossible but more complicated.

Zack

On Wed, 28 Dec 2005, dlc wrote:

> Indeed,
> 
>    I generally sample the bit stream at the fastest rate I can, between
> 16 and 60X the clock rate, then arrange subsequent checks to be centered
> in the rest of the bits.  I've gotten a 4MHz 12C508A to run reliably on
> its internal RC oscillator at 9600 bps and a Tiny12 at 1MHz at 9600 bps.
>   The 12C508 was totally on a timed FSM, the Tiny12 had the advantage of
> having an IRQ that I could use on a timer.  All in assembly of course,
> you probably couldn't get a receiver to work well using a high level
> language.
> 
> fun stuff,
> DLC
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.