#include #include #include #include #include #include typedef unsigned long int uint32_t; /* ******************************************************************* */ /* Timerinterrupt 0 im Register TCCR0 wird der Teilungsfaktor eingestellt CS02 CS01 CS00 Description 0 0 0 Stop, Timer/Counter0 is stopped. 0 0 1 CK 0 1 0 CK / 8 0 1 1 CK / 64 1 0 0 CK / 256 1 0 1 CK / 1024 */ /* ******************************************************************* */ volatile int T=0; volatile uint32_t timestamp= 0; void Timerinit(void) { TIMSK=0x02; //Timer/Counter Interrupt Mask OCR0 =0xFA; //Output Compare Register = 250 TCCR0=0xA; //Timer/Counter Control Register auf CK/8 und CTC-Mode sei(); //All Interrupt enable DDRC=0xFF; PORTC=0x00; } void UART_Init (void) { UBRRL = F_CPU / (16 * 9600UL) - 1; /*Enable reciever and transmitter */ UCSRB = (1<