//**************************************************************************** // //Initalisierung ATmega328 // //**************************************************************************** #include #include #include #include //***************************************************************************** // MCU - Init // Input: - // Output: - //***************************************************************************** void MCUinit(void) { //unsigned char uc_Start; SREG &= 0x7F; //global INT aus // uc_Start = MCUCSR; // uc_Start = MCUCR; MCUCR = 0x00; EICRA = 0x00; //extended ext ints EIMSK = 0x00; // GICR = 0x00; //extended ext ints // GIFR = 0x00; // SFIOR &= 0xFB; //PULL UP PRR = 0x00; // Timer1 TCCR1A = 0; TCCR1B = 0; TIMSK1 = 0; TIFR1 = 0; // Input/Output Ports initialization as input // Port B DDRB = 0xDF; PORTB = 0x20; // Port C // DDRC = 0xFF; // PORTC = 0x00; // Port D //UART DDRD = 0xFE; PORTD = 0x00; SREG |= 0x80; // return(uc_Start); }