View previous topic :: View next topic |
Author |
Message |
karthik
Joined: 27 Nov 2008 Posts: 7
|
PIC24F PCDIDE #int_global invalid error |
Posted: Thu Nov 27, 2008 5:50 am |
|
|
Hi,
I am working on PCDIDE compiler for PIC24FJ128GA010.
I am trying to configure the global interrupt (#int_global) for my timers so that I can write the code for interrupts manually.
But I am getting a Invalid Pre-processor directive error during compilation.
I confirmed that the compiler supports the global interrupts from the Compiler manual.
Has someone faced such a problem? I suspect a bug with the compiler. Any info regarding this would be of great help.
Thanks in advance.
- Karthik |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Nov 27, 2008 11:39 am |
|
|
Read the manual thoroughly anew. PIC24F has no global interrupt, just individual interrupts for each peripheral. It has a global interrupt enable flag of course, but no directive with this name. |
|
![](templates/subSilver/images/spacer.gif) |
karthik
Joined: 27 Nov 2008 Posts: 7
|
|
Posted: Fri Nov 28, 2008 12:21 am |
|
|
Thanks a lot for the reply FvM.
I now got the point u mentioned. PIC24F doesn't have a global interrupt vector location. I just went by the assumption looking at the compiler directive. My appologies for suspecting the compiler.
Sorry to bug everyone again. I have a query on the same lines.
The main reason why I wanted to use the global interrupt directive was to reduce the time taken by the ISR in saving the registers.
I wanted to bypass the compiler generated ISR code by manually coding the necessary register saves.
Is there any way to do this with some directive? I thought #int_global was one of the ways but I think its not possible with PIC24F :(
Thanks again! |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Nov 28, 2008 12:35 am |
|
|
Yes, I also think that hand-coding an ISR may be meaningful in some special cases. I thought about this option, when adapting a Microchip bootloader concept. Unfortunately, PCD does (yet) support neither setting of an interrupt vector to an arbitrary address nor to skip the default save/restore of work registers in an assembly coded ISR. The first option would also help to support interrupts forgotten by CCS in the present compiler version. Cause these options would be rather easy to implement, I hope we'll get them some time. |
|
![](templates/subSilver/images/spacer.gif) |
karthik
Joined: 27 Nov 2008 Posts: 7
|
|
Posted: Fri Nov 28, 2008 12:57 am |
|
|
Thanks a lot again FvM for the quick response.
The information was of great help.
Too bad that its impossible to alter any of the isr code.
Donno how long do we need to wait till CCS comes out with a solution to this problem. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Nov 28, 2008 3:39 am |
|
|
What happens if you don't declare the ISR in CCS at all, but simply 'ORG' your own code to the ISR location?. This was what we had to do years ago, with PCM, before the latter interrupt handling appeared, and it might well work the same.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
karthik
Joined: 27 Nov 2008 Posts: 7
|
|
Posted: Fri Nov 28, 2008 4:04 am |
|
|
I have been trying to use the #org directive to place the user ISR manually at the Interrupt vector address. But no luck at all :(
I keep getting invalid org range error. Have tried with different combination of start and end addresses. Even tried #rom address to initialize the interrupt vector location with the address of the user isr. But all in vain.
The #org directive works fine when used in the user program memory space but not in case of interrupt vector addresses.
Please let me know if somebody has success in implementing this method on PIC24 PCDIDE compilers. |
|
![](templates/subSilver/images/spacer.gif) |
tom.ayars
Joined: 23 Jun 2008 Posts: 14
|
|
Posted: Thu Aug 26, 2010 9:56 am |
|
|
Hello all,
I realize this post hasnt seen any action in a few years, but I thought this would be the best place to ask my question.
I am using the PIC24FJ16GA002 and as the previous poster stated, there is no global interrupt on these devices.
I have written a bootloader in the past for the PIC18 series and used the #int_global with the jump_to_isr() function. My questions is, is there a way to duplicate this process on the PIC24F? |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Aug 26, 2010 12:05 pm |
|
|
No. jump_to_isr() isn't provided with PCD. There are several possible methods for interrupt handling with bootloaders. You should review the respective discussions at ccs forum and also study the operation of the PCD bootloader example shipped with PCD.
Personally I prefer a safe bootloader design according to Microchip AN1157. |
|
![](templates/subSilver/images/spacer.gif) |
|