Gast
#1587685
Hallo,
ich habe schon bei meheren avrs die uart programmiert.
Hat bis jetzt immer geklappt. Zb atmega16 at90can atmega1280.
Jetzt habe ich ein atmega8
Meine init ist so
void uart0_init(void)
{
UCSRB = 0x00; //disable while setting baud rate
UCSRA = 0x00;
UCSRC = URSEL | 0x06;
UBRRH = 0x00; //set baud rate hi
UBRRL = 0x33; //set baud rate lo
UCSRB = 0x98;
}
void uart0_putc(char c)
{
while(!(UCSRA & (1<<UDR)));// Wait until Rs232 is ready
UDR=c;
}
Aber mein transmitter ist niemlas ready. Mein programm hängt immer in
der while schleife was ist da los. Hat bis jetzt bei jedem atmega
geklappt