Joerg Wunsch wrote:
> [...]
> For UART communication, the precision of the internal RC oscillator is
> sufficient.  The only tricky thing is if you want to use it on Vcc
> other than 5 V, because the factory-shipped calibration values are all
> provided for 5 V only.  For other voltages, you've got to find your
> own calibration method.

I'll share a recent experience here - I had a design using the 1MHz
internal RC, and used the serial port at 9600 to communicate with
a host. I used the standard datasheet values of UBRR = 12, U2X =1.

I found that some units were failing when receiving back-to-back
characters from the host. I identified the problem as cumulative
error in the clock rate, resulting in characters late in the
string being sampled incorrectly (and hence garbled.) Adding
enough inter-character time on the host allows the receiver
to re-sample the start-bit correctly and the errors are not
cumulative across the string. I have a hunch that if I could
use U2X = 0, then the problem would not be as severe (e.g.
use the 2MHz RC instead.)

While I now have a workaround, I did start to wonder about
(re)calibrating the internal RC clock as part of my production
process - has anyone on the list implemented the calibration
procedure described in appnote AVR053 under a unix-like substance,
in a production environment (e.g. clicky-clicky scroll-scroll
need not apply) ?

Ideally, I'm looking for rule(s) I can add to my makefile.

I'm OK using an Atmel programmer, and according to appnote AVR068,
I can send the CMD_OSCCAL (0x05) command - but I have not seen
that supported by the programming tools (avrdude etc.)
I coudl then see calibrating the RC to 0.9216MHz instead,
giving 0% error, but 1MHz with improved accuracy would be an
adequate first step.
-- 
[EMAIL PROTECTED]

Andy Warner             Voice: (612) 801-8549   Fax: (208) 575-5634


_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to