Hier:
Neu:Code:UCSRC|=(1<<URSEL) | (3<<UCSZ0);
(8-bit, Asynchron, 1xStopp-bit)Code:UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
Mit geänderten #define's funktioniert es bei mir:
(F_CPU steht bei mir im Makefile)Code:#include <avr/io.h> #define BAUD 115200UL #define UBRR_BAUD ((F_CPU/(16L*BAUD))-1) int main(void) { UBRRH = (uint8_t) (UBRR_BAUD>>8); UBRRL = (uint8_t) (UBRR_BAUD & 0xFF); UCSRB =(1<<TXEN); UCSRC = (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); while(1){ while(!(UCSRA & (1<<UDRE))) { } UDR='x'; } return 0; }
Gruß
Stefan






Zitieren

Lesezeichen