avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] cant get usart working on atmega323


From: Jamie Morken
Subject: [avr-gcc-list] cant get usart working on atmega323
Date: Mon, 08 Jul 2002 17:12:25 -0700

Hi all,

I have a board with an at90s8535 on it and a board with an atmega323 on it.
I am using gcctest7 and can only get the uart on the at90s8535 board
working.

I know that the atmega323 doesn't have the UCR register and instead uses the
UCSRB register but modifying this (see below) still gives incorrect output
on the uart.  Any help please!? :)

Here is the code from uart.c that may be the problem I think..

void UART_Init(void)
{
    UART_Ready        = 1;
    UART_ReceivedChar = 0;
    pUART_Buffer      = 0;
    /* enable RxD/TxD and interrupts */
    //outp(BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN),UCR);
 outp(BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN),UCSRB);
    /* set baud rate */
    outp( (u08)UART_BAUD_SELECT, UBRR);
    /* enable interrupts */
    sei();
}


Thanks for any help!

cheers,
Jamie Morken


avr-gcc-list at http://avr1.org



reply via email to

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