Hi
Ich will einen Timer Interrupt mit T3 programmieren. Solange ich die
Interrupt-Funktion auskommentiere ist alles in Ordnung, ansonsten hagelt
es Fehlermeldungen. Ich kann beim besten Willen keinen Fehler finden.
Ich habe bereits mit Beispielen aus einem Buch und Online-Beispielen
verglichen, habe aber nichts herausgefunden.
Ich verwende die TASKING EDE Trial Version für C166/ST10 v8.6r3
1 | int i=0;
|
2 | void timer(void) interrupt 0x23
|
3 | {
|
4 | i+=1;
|
5 | }
|
6 |
|
7 |
|
8 | void main(void)
|
9 | {
|
10 | T3CON = 0x0086; // Prescale Factor 512, Timer Mode, STEHT NOCH, läuft abwärts
|
11 | T2CON = 0x0020; // Reload Mode
|
12 | T3 = 0x2625; // = 9765d
|
13 | T2 = 0x2625;
|
14 |
|
15 | T3IC = 0x88; // niedriegster GLVL (000), ILVL (0001), INTERRUPT ENABLED
|
16 | IEN = 1; // Alle Interupts an
|
17 | T3R = 0x1; // Timer laufen lassen
|
18 |
|
19 | while(1){}
|
20 | }
|
Die Fehlermeldungen sind:
1 | TASKING program builder v8.6r3 Build 088
|
2 | Preprocessing start.asm
|
3 | Compiling and assembling main.c
|
4 | main.c:
|
5 | 20: i=2;
|
6 | E 42: syntax error, expecting declaration
|
7 | 26: T3CON = 0x0086;
|
8 | E 42: syntax error, expecting declaration
|
9 | 29: T2CON = 0x0020;
|
10 | E 157: "T2CON" is not a formal parameter
|
11 | E 129: cannot initialize "T2CON"
|
12 | 32: T3 = 0x2625;
|
13 | E 157: "T3" is not a formal parameter
|
14 | E 129: cannot initialize "T3"
|
15 | 33: T2 = 0x2625;
|
16 | E 157: "T2" is not a formal parameter
|
17 | E 129: cannot initialize "T2"
|
18 | 38: T3IC = 0x88;
|
19 | E 157: "T3IC" is not a formal parameter
|
20 | E 129: cannot initialize "T3IC"
|
21 | 41: IEN = 1;
|
22 | E 157: "IEN" is not a formal parameter
|
23 | E 129: cannot initialize "IEN"
|
24 | 42: T3R = 0x1;
|
25 | E 157: "T3R" is not a formal parameter
|
26 | E 129: cannot initialize "T3R"
|
27 | E 43: unrecoverable syntax error, skipping to end of file
|
28 | total errors: 15, warnings: 0
|
29 | wmk: *** action exited with value 1
|
Wie gesagt, ohne die Interrupt Funktion läuft es rund.