# Interupt and Reset vectors in 24F series

Status
Not open for further replies.

#### Diver300

##### Well-Known Member
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:-

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?

#### Diver300

##### Well-Known Member
I know that it's 2 years since I posed this question.

I'll add this so that I can always find it here if I ever forget how to do this again......

You put this at the start of the code.
Code:
.global __reset
__reset:

Obvious, if you know.

Status
Not open for further replies.

Replies
1
Views
1K
Replies
0
Views
694
Replies
6
Views
2K
Replies
1
Views
813
Replies
12
Views
2K