Hallo
So sollte es gehen.Code:#include <inttypes.h> // Allgemeine Bibliotheken #include <avr/io.h> #include <avr/interrupt.h> #include <avr/signal.h> #include <stdint.h> SIGNAL(SIG_OVERFLOW0) { TCNT0=200; PORTB=~PORTB; } int main (void) { DDRB=0xFF; PORTB=0x00; TCCR0=(5<<CS00); TCNT0=0x00; TIMSK=(1<<TOIE0); sei(); for(;;){} }
Soll das so sein ?TCCR0=(5<<CS00);
besser
Das muß groß seinTCCR0=(1<<CS00) | (1<< CS02);
^SIGNAL(SIG_OVERFLOW0)
Je nach Takt ist das aber zu schnell, um das blinken erkennen zu können.
Siehe auch http://www.mikrocontroller.net/artic...R-GCC-Tutorial
MFG
Dieter
Lesezeichen