#include // Einbinden der Bibliothek #include // Einbinden der Bibliothek volatile uint8_t ms_tick = 0; // wird alle 10ms aufgerufen ISR (TIMER3_COMPA_vect) // Interrupt aufruf { ms_tick = 42; } void timer3_init(void) { // EMPFANGEN VON DATEN // Timer3 - 10ms bei 2 Mhz TCCR3B = 0x00; // Stop ---> timer/counter control register //TCCR3A = 0x00; //TCCR3C = 0x00; OCR3A = 19999; // TOP - Timer zählt bis zum maximalen wert von 19999 und gibt einen Interrupt aus (Seite 140 im Datenblatt) TIMSK3 |= (1< can general control register (Seite 252 im Datenblatt) // reset all message objekts for (i=0; i<15; i++) // Schleife { CANPAGE = (i<<4); // select message objekt CANCDMOB = (1<> 3); // Setzen der Bits 3-10 der Nachrichten-ID in das CANIDT1 Register CANIDT2 = (id << 5); // Setzen der Bits 0-2 der Nachrichten-ID in das CANIDT2 Register CANIDM1 = 0xff; // alles auf High-Pegel setzten CANIDM2 = 0xe0; CANIDM4 = (1< 99) { can_delay = 0; CANPAGE = (1<<4); // Auswählen des MOB1 if(CANSTMOB & (1<