avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] ATMEGA162 USAR operation


From: Jurek Szczesiul
Subject: Re: [avr-chat] ATMEGA162 USAR operation
Date: Sat, 18 Feb 2006 14:36:22 +0100

Hi Jim .

Here's an  Atmega162 working usart0 configuration sequence :

 void init_uart0(void)
{
 // ==== usart 0 configuration ====
 // 2400 baud with 7373 kHz osc./error=0,0%
 // data 8/stop 1/parity ODD
 // receiver ON/transmitter ON/recv interrupt enabled
 UBRR0H = 0x00;
 UBRR0L = 0xBF;
 UCSR0A = 0x0;
 UCSR0B = _BV(RXEN0) | _BV(TXEN0) | _BV(RXCIE0);
 UCSR0C = _BV(URSEL0) | _BV(UCSZ00) | _BV(UCSZ01) | _BV(UPM01) | _BV(UPM00);
 // ==== end usart ====
}

Best regards Jurek S.




reply via email to

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