View previous topic :: View next topic |
Author |
Message |
ck
Joined: 02 May 2012 Posts: 18
|
PIC24 IVT Remap [solved] |
Posted: Wed May 09, 2012 1:42 am |
|
|
Hi guys,
i have done a CAN-Bus bootloader for PIC24 and it works good without interrupts.
I have some problem on IVT remapping.
I have a Timer1 interrupt placed at 0x00001A Pic's location by default.
In my bootloader i wrote:
Code: |
#build(reset=0x000000, interrupt=0x000200)
|
and
Code: |
#ORG 0x1A, 0x1D
void TIMER1_REMAP(void)
{
#asm
goto 0x003030
#endasm
}
|
This means that when Timer1 interrupt occurs, it has to jump to location 0x03030
In my user_program i put #int_timer1 at 0x003030:
Code: |
#build (reset=0x003000, interrupt=0x003004)
#org 0, 0x002FFE {}
|
Look at Bootloader-program-memory i see:
Location Asm Code
0x00001A goto 0x003030
In user_program:
Location Asm Code
0x003030 goto my_timer1_routine()
But doesn't work. Please can you help me?
Thanks in advance
P.S: PIC24HJ256GP610 ccs 4.104
Last edited by ck on Wed May 09, 2012 3:55 am; edited 2 times in total |
|
|
ck
Joined: 02 May 2012 Posts: 18
|
|
Posted: Wed May 09, 2012 3:03 am |
|
|
Update:
I have try the TIMER1 interrupt in bootloader with same principe.
At location 0x001A i put goto 0x0022C
and in 0x0022C i put my #int_timer1 routine.
Still doen't work. In Simulation i see an Address error trap |
|
|
ck
Joined: 02 May 2012 Posts: 18
|
|
Posted: Wed May 09, 2012 3:54 am |
|
|
I understand my error. Now it works. |
|
|
|