Hallo Gemeinde, Kann mir jemand sagen wieso ich er nicht jede Sekunde in den OVF springt ?!
1 | // LED = PORTD.4
|
2 | |
3 | |
4 | #define F_CPU 16000000UL
|
5 | #include <avr/io.h> |
6 | #include <avr/interrupt.h> |
7 | |
8 | |
9 | ISR( TIMER2_OVF_vect ) { |
10 | |
11 | PORTD ^= _BV(PD4); |
12 | TCNT2 = 131; |
13 | |
14 | }
|
15 | |
16 | |
17 | int main(void) |
18 | {
|
19 | |
20 | |
21 | DDRD = 0xff; |
22 | // PORTD = (0<<PD4);
|
23 | |
24 | |
25 | |
26 | TCCR2 |= (1<<CS22) | (0<<CS21) | (1<<CS20); |
27 | TIMSK |= (1<<TOIE2); |
28 | sei (); |
29 | |
30 | while(1) |
31 | {
|
32 | //TODO:: Please write your application code
|
33 | }
|
34 | }
|