Hallo!

Ich habe alles geändert, so wie es beschrieben ist, doch es funktioniert immer noch nicht. Hat einer noch ne Idee?
Danke!

Hier noch mal der geänderte Quellcode:

#include <avr/io.h>
#include <avr/interrupt.h>


#define F_CPU 1000000UL
#define BAUD 9600UL
#define UBRR_BAUD ((F_CPU/(16L*BAUD))-1)

volatile uint8_t buffer;

void uart_init(void)
{

UBRRH = (uint8_t) (UBRR_BAUD>>;
UBRRL = (uint8_t) (UBRR_BAUD & 0xFF);
UCSRB = (1<<TXEN) | (1<<RXEN)|(1<<RXCIE);
UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
}


ISR(USART_RXC_vect)
{
buffer = UDR;
}


void led_init(void)
{
if(buffer==0x31)
PORTA=0x01;

else
PORTA=0x00;
}


int main(void)
{
DDRA = 0xff;
uart_init();
sei();
while(1){
led_init();
}
return 0;
}