Moin Leute, bin gerade im AVR-Studio im Simulator am testen. Könnt ihr mir sagen wieso der nicht in den Interrupt springt? Hab schon einiges getestet aber nichts hat funktioniert. Hatte mir da einen Breakpoint gesetzt. Auch nach 100.000 Zyklen ist der noch nicht in den Interrupt reingesprungen.
1 | #define F_CPU 8000000L
|
2 | #include <avr\io.h> |
3 | #include <stdlib.h> |
4 | #include <avr/interrupt.h> |
5 | |
6 | volatile int32_t zahl=0; |
7 | |
8 | ISR(TIMER1_OVF_vect) |
9 | {
|
10 | TCNT1 = 128; |
11 | zahl++; |
12 | }
|
13 | |
14 | void timer1_init(void) |
15 | {
|
16 | TCCR1 |= (1<<CS10); // Prescaler=1 |
17 | TIMSK |= (1<<TOIE1); // Timeroverflow Interrupt aktiv |
18 | TCNT1 = 128; |
19 | sei(); |
20 | }
|
21 | |
22 | int main(void) |
23 | {
|
24 | timer1_init(); |
25 | |
26 | while(1) |
27 | {
|
28 | zahl++; |
29 | }
|
30 | }
|