#include #include #include #include #include #include #ifndef OCR1A #define OCR1A OCR1 // 2313 support #endif #ifndef WGM12 #define WGM12 CTC1 // 2313 support #endif #define F_CPU 8000000UL #define BAUD 9600UL #define UBRR_BAUD ((F_CPU/(16L*BAUD))-1) //LED Port Initialisierung #define LED_DDR DDRA #define LED_PORT PORTA #define LED0 0 #define LED1 1 #define LED2 2 //Timer Einstellung Variablen #define DEBOUNCE 256L #define uchar unsigned char #define uint unsigned int uchar prescaler; uchar volatile std; uchar volatile min; uchar volatile sek; unsigned int counter = 0; unsigned int gestellt = 0; //Variablen für USART (RS232) Übertragung char buffer[10]; volatile uint8_t habekommando; //Initialisierung USART void uart_init(void) { UBRRH = (uint8_t) (UBRR_BAUD>>8); UBRRL = (uint8_t) (UBRR_BAUD & 0xFF); UCSRB = (1<= 60) { min++; sek = 0; } if(min >= 60) { std++; min = 0; } if(std >= 24) { std = 0; } } } //Hauptprogramm int main( void ) { LED_PORT = 0xFF; //LED_PORT wird auf 1 gesetzt LED_DDR = 0xFF; TCCR1B = 1<