avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] Trouble with USART0 on ATmega644A


From: Rick Mann
Subject: [avr-chat] Trouble with USART0 on ATmega644A
Date: Wed, 5 Jan 2011 23:41:42 -0800

Hrm, I had the ATmega32A working just fine. But on the 644A I can't seem to pin 
down the baud rate (or something else is wrong). According to the docs, the 
'644A defaults to internal RC at 8 MHz. So, I've tried a number of variations 
of settings, with U2X0 set and clear. Here's the latest:

#define F_CPU                   8000000UL
#define UART_BAUD               115200

{
    UBRR0 = 8;  //  3;  //  (F_CPU / (16UL * UART_BAUD)) - 1;
    UCSR0A = 0 << U2X0;
    UCSR0B =      1 << RXEN0
                | 1 << TXEN0
                | 1 << RXCIE0;
    UCSR0C =      0x0 << UMSEL00        //  Async USART
                | 0x0 << UPM00          //  No parity
                | 0 << USBS0            //  1 stop bit
                | 0x3 << UCSZ00;        //  8-bit
}


But I get varying forms of gibberish characteristic of baud rate mismatches.

Any suggestions?

TIA,
Rick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]