Yahoo Groups archive

AVR-Chat

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

Thread

Re: [AVR-Chat] Xtal and Baud Rate

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-09 by John Samperi

At 07:59 AM 10/03/2009, you wrote:
>#define UBRRVAL (((F_CPU/(USART_BAUDRATE*4UL)))) // using the double baud flag

>May want to try *8UL instead of *4UL for double speed. (usually *16)

I know you would NEVER have overlooked that in ASM.  ;-)


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-09 by David VanHorn

On Mon, Mar 9, 2009 at 5:38 PM, John Samperi
<samperi@ampertronics.com.au> wrote:
> At 07:59 AM 10/03/2009, you wrote:
>>#define UBRRVAL (((F_CPU/(USART_BAUDRATE*4UL)))) // using the double baud flag
>
>>May want to try *8UL instead of *4UL for double speed. (usually *16)
>
> I know you would NEVER have overlooked that in ASM.  ;-)

The problem is that the equation I quoted IS giving me the right baud.
I don't know why..

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-10 by Enki

David VanHorn wrote:
> On Mon, Mar 9, 2009 at 5:38 PM, John Samperi
> <samperi@ampertronics.com.au> wrote:
>   
>> At 07:59 AM 10/03/2009, you wrote:
>>     
>>> #define UBRRVAL (((F_CPU/(USART_BAUDRATE*4UL)))) // using the double baud flag
>>>       
>>> May want to try *8UL instead of *4UL for double speed. (usually *16)
>>>       
>> I know you would NEVER have overlooked that in ASM.  ;-)
>>     
>
> The problem is that the equation I quoted IS giving me the right baud.
> I don't know why..
>
>   
    Does the clock prescaler is correctly programmed?

    Mark Jordan

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-10 by David VanHorn

>    Does the clock prescaler is correctly programmed?

Prescaler?

I only see UBRRH and UBRRL.
Is there a prescaler between the UART and the Xtal in a M32?

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-10 by Enki

David VanHorn wrote:
>>    Does the clock prescaler is correctly programmed?
>>     
>
> Prescaler?
>
> I only see UBRRH and UBRRL.
> Is there a prescaler between the UART and the Xtal in a M32?
>
>   
    Sorry, I thought it has one like the ATMega48.

    What is your exact baud rate using a 4MHz clock?

    Mark Jordan

Re: [AVR-Chat] Xtal and Baud Rate

2009-03-10 by David VanHorn

>    Sorry, I thought it has one like the ATMega48.
>
>    What is your exact baud rate using a 4MHz clock?

I'll check it again in the morning, but I was getting good data with
the PC set to 115200, and the equation as quoted, with *2 instead of
*16

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.