I'm programming 24F series PICs in assembly language and just thinking of getting into using interrupts.
The program in a 24F starts at 0x200, and the interrupt vectors are 0x04 - 0xfe. The alternative interrupt vectors are 0x100 - 0x1fe
Resets put the program counter to 0x00 so a GOTO 0x200 needs to be put into the first lines of code. The only way that I could get MPLAB to put that GOTO in was to modify the .gld file as follows:-
I am sure that there should be a better way of doing this. If the .gld file needed that line, Microchip would have added it.
Now I want to know how to add the interrupt vectors into the code.
Can anyone tell me the right way to get the GOTO 0x200 to be inserted or how to add interrupt vectors?
The program in a 24F starts at 0x200, and the interrupt vectors are 0x04 - 0xfe. The alternative interrupt vectors are 0x100 - 0x1fe
Resets put the program counter to 0x00 so a GOTO 0x200 needs to be put into the first lines of code. The only way that I could get MPLAB to put that GOTO in was to modify the .gld file as follows:-
Code:
__CONFIG2 = 0xABFC;
__CONFIG1 = 0xABFE;
[COLOR="Red"]__reset = 0x200; /* Added by Diver300 */[/COLOR]
__IVT_BASE = 0x4;
__AIVT_BASE = 0x104;
__DATA_BASE = 0x800;
__CODE_BASE = 0x200;
I am sure that there should be a better way of doing this. If the .gld file needed that line, Microchip would have added it.
Now I want to know how to add the interrupt vectors into the code.
Can anyone tell me the right way to get the GOTO 0x200 to be inserted or how to add interrupt vectors?