Tolle Seite ist das. Da ist vermutlich dieser Auszug für Dich interessant:

Code:
/***********************************************************
	Funktionsbibliothek für den USART des Atmega8
***********************************************************/

#include <avr/io.h>

#define F_CPU 4000000
#define USART_BAUD_RATE 9600
#define USART_BAUD_SELECT (F_CPU/(USART_BAUD_RATE*16l)-1)

void USART_Init(void) {
    UCSRB = _BV(RXCIE) | _BV(TXCIE) | _BV(RXEN) | _BV(TXEN);
    UBRRL = (unsigned char) USART_BAUD_SELECT;
}

void USART_transmit (unsigned char c) {
	while (!(UCSRA & (1<<UDRE))) {}
	UDR = c;
}

unsigned char USART_receive (void) {
    while(!(UCSRA & (1<<RXC))) {}
    return UDR;
}

void USART_transmit_string (unsigned char *string) {
    while (!(UCSRA & (1<<UDRE))) {}
	while ( *string)
		USART_transmit (*string++);
}