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 np np

You could try some adaptive software to work out the baud rate ?

We wanted to use a cheap internal osc so had the PC send out some 55H characters before transmission.
The PIC measured the bits and used the value as the length of a bit.
It then could match itself to the rx and tx of the PC.

www.ckp-railways.talktalk.net/pcbcad21.htm



----- Original Message ----
From: Mike Harrison <mike@whitewing.co.uk>
To: AVR-Chat@yahoogroups.com
Sent: Thursday, 31 May, 2007 10:45:55 PM
Subject: Re: [AVR-Chat] Re: What serial speed (RS232) can I achieve using  the built-in osc...









  


    
            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.



>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@yahoogroup s.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

>

>

>



    
  

    
    




<!--

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.