View previous topic :: View next topic |
Author |
Message |
johnjohn7188
Joined: 29 Oct 2008 Posts: 8 Location: Irvine, CA
|
Interrupts not working w/ new interrupt and reset vectors |
Posted: Mon Jan 12, 2009 11:56 am |
|
|
I'm using a PIC18F2480. I enabled the CAN Rx interrupts in order to receive messages as soon as they arrive (somewhat different from CCS's sample code). The interrupts work great. However, when i move the reset and interrupt vectors to different addresses in order to accommodate for my bootloader, the interrupts stop working. I don't even think they're enabled. The PIC does not reset nor stop functioning. Everything works great except for the interrupts. Is there anything I missed when shifting the reset and interrupt vectors to a different address space?
Thanks! |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Mon Jan 12, 2009 1:27 pm |
|
|
The key here is the type of bootloader and how it works.
For example, the bootloaders I use are high memory bootloaders. Except for the initial reset vector, these bootloaders do not load any code into low memory and therefore there is no need to remap interrupt vectors. In fact, if you did remap the vectors, my bootloaders would have no way of knowing how to link the real interrupt vectors to the remapped vectors. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
johnjohn7188
Joined: 29 Oct 2008 Posts: 8 Location: Irvine, CA
|
|
Posted: Mon Jan 12, 2009 2:21 pm |
|
|
Thanks for the responses!
I read ckielstra's comments, but he does not mention the interrupt vectors not working after relocating them. He states that more memory is used/wasted, though, which is not really too big of a concern to me.
So it seems that the interrupts should be working correctly even w/ the interrupt vectors relocated to a different memory range.
Any other ideas why interrupts aren't working correctly? Thanks! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 12, 2009 3:38 pm |
|
|
Post a short test program so we can look at it. Make it as small as
possible. Put in only the lines that are necessary to show the problem.
But also, it must be compilable (with #include, #fuses, #use delay, main).
Post your compiler version. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Mon Jan 12, 2009 4:15 pm |
|
|
johnjohn7188 wrote: | Thanks for the responses!
I read ckielstra's comments, but he does not mention the interrupt vectors not working after relocating them. He states that more memory is used/wasted, though, which is not really too big of a concern to me.
So it seems that the interrupts should be working correctly even w/ the interrupt vectors relocated to a different memory range.
Any other ideas why interrupts aren't working correctly? Thanks! |
How are you telling the bootloader that the vectors are remapped and did you even need to remap them? _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|