#include #include /* USART-Init beim ATmega16 */ #ifndef F_CPU #define F_CPU 1000000 // Oszillator-Frequenz in Hz #endif // Hilfsmakro zur UBRR-Berechnung ("Formel" laut Datenblatt) #define UART_UBRR_CALC(BAUD_,FREQ_) ((FREQ_)/((BAUD_)*16L)-1) #define UART_BAUD_RATE 9600 int temp; ISR(USART_RXC_vect) { temp=UDR; if(temp=='E') { PORTB=0x00; } else if(temp=='A') { PORTB=0xFF; } else {}; } ISR(EXT_INT0_vect) { while (!(UCSRA & (1<> 8 ); UBRRL = (uint8_t)UART_UBRR_CALC( UART_BAUD_RATE, F_CPU ); GICR |= (1<