#include #include #ifndef F_CPU #define F_CPU 1000000UL /* Quarz mit 1 Mhz */ #endif //#include /* definiert _delay_ms() ab avr-libc Version 1.2.0 */ #include /* in der aktuellen Version in util/ */ void uart_init() { // UART Transmitter anschalten // Data mode 8N1, asynchron 4800 1MHZ UBRRH = 0; // Highbyte ist 0 UBRRL = 207; // Lowbyte ist 12 ( dezimal ) UCSRB = (1 << TXEN)|( 1 << RXEN ); // UART TX RX einschalten UCSRC =(1 << URSEL) | (1 << UCSZ1) | (1 << UCSZ0); } void uart_putc(unsigned char c) { while (!(UCSRA & (1<