Yahoo Groups archive

AVR-Chat

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

Thread

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

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

2007-05-30 by BobGardner@aol.com

In a message dated 5/30/2007 6:24:19 P.M. Eastern Daylight Time,  
catalin_cluj@hotmail.com writes:

What  serial speed (RS232) can I achieve using the built-in oscilator, 
running  at 8MHz?

I'm using the "Fleury" serial library, but it looks like I  can't go above 
38400bps...

would this be because the RC clock is  not precise enough, or because 8MHz is 
not fast enough to go above  38400?




==================================
Serial speed needs to be within 2%. RC osc might be off by +-5% to start,  
but you can tweak in, but then it might drift off more than 2% with temp, so you 
 really need at least a resonator.



************************************** See what's free at http://www.aol.com.


[Non-text portions of this message have been removed]

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

2007-05-31 by dlc

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.

DLC

Cat wrote:
> Thanks guys,
> 
> I'll connect it to an ext osc, but I was curious.
> 
> Cat
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

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

2007-05-31 by David VanHorn

On 5/30/07, dlc <dlc@frii.com> 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)

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

2007-05-31 by dlc@frii.com

> On 5/30/07, dlc <dlc@frii.com> 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

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

2007-05-31 by kernels_nz

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
Show quoted textHide quoted text
> >> 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
>

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
Show quoted textHide quoted text
> 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
>
>
>
>

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

2007-05-31 by David VanHorn

On 5/31/07, dlc@frii.com <dlc@frii.com> wrote:
>   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).

that's it exactly..

Now if you want to, you can tune the baud rate observing the bit
edges, predicting where they "should be" vs where you see them, but
that's another level of difficulty.
Using a resonator pretty much eliminates any worries over vcc/temp variations.

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

2007-05-31 by Mike Harrison

On Thu, 31 May 2007 15:27:21 -0600 (MDT), you wrote:

>  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 

..or voltage

>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).

There can also be significant jitter - seems to be worse on some parts than others - not sure if
Microchip's tolerance specs take this into account or not.
Show quoted textHide quoted text
>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
>>
>>
>>
>>
>
>
>
>
> 
>Yahoo! Groups Links
>
>
>

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.