Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: What serial speed (RS232) can I achieve using the built-in osc...

2007-05-31 by dlc@frii.com

That is a brilliant tuning suggestion!  I never thought of that one
<chuckle>.  Another "gotcha" when using the internal RC oscillators is
that they are not as stable over temperature as a resonator or crystal. 
As long as you stay pretty close to the 20-25C temperature range they
are fine, otherwise they can drift (see data sheet for the drift rate).

DLC

> Hi guys,
>
> Only bit of advice that I can give from my own experience is that the
> on chip RC oscillator is FINE for UART when your running on a accurate
> 5V supply AND you program the OSCCAL register with the correct value.
>
> If your VCC is low (3V or 3.3V) etc, you can still use the UART by
> setting the value of OSCCAL correctly (Not the value that the
> programmer gives you), I have done this by entering into a loop where
> I increment the OSCCAL register, then output it's value out the serial
> port, as soon as you can read the value, you know you have a value for
> OSCCAL that will allow the UART to work correctly. This is NOT a good
> way to do things for mass production, but is fine for homers and
> on-offs. The loop looks something like:
>
> OSCCAL = 0;
> while(OSCCAL < 255){
>
>   OSCCAL++;
>   UART_Write_Number(OSCCAL);
> }
>
>
> Cheers
> Hein B
> Auckland, New Zealand
>
> --- In AVR-Chat@yahoogroups.com, dlc@... wrote:
>>
>> > On 5/30/07, dlc <dlc@...> wrote:
>> >> I've gotten 9600 baud to work well with the internal 1MHz
> oscillators of
>> >> the Tiny11.  You can handle quite a bit of slop reading serial
> data if
>> >> your baud rate is low enough.
>> >
>> > Unfortunately, clock speed error is proportional, so 5% error is 5%
>> > error in baud rate, no matter what baud rate you pick.  But, as the
>> > baud rates get higher, the granularity of the steps in the UBRR
>> > setting get proportionally larger (ie: 20 vs 21 is smaller error than
>> > 3 vs 2)
>>
>>   There is no hardware UART in these small chips, I bit bang my serial
>> there and that seems to be more tolerant of bit slip and stretch.  Being
>> in software gives me the option of very high granularity.  The hardware
>> UARTS are not as tolerant of error.  That is probably the difference.
>>
>> DLC
>> --
>> Dennis Clark
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

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.