CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC24F PCDIDE #int_global invalid error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
karthik



Joined: 27 Nov 2008
Posts: 7

View user's profile Send private message

PIC24F PCDIDE #int_global invalid error
PostPosted: Thu Nov 27, 2008 5:50 am     Reply with quote

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
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Nov 27, 2008 11:39 am     Reply with quote

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.
karthik



Joined: 27 Nov 2008
Posts: 7

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 12:21 am     Reply with quote

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!
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 12:35 am     Reply with quote

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.
karthik



Joined: 27 Nov 2008
Posts: 7

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 12:57 am     Reply with quote

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.
Ttelmah
Guest







PostPosted: Fri Nov 28, 2008 3:39 am     Reply with quote

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
karthik



Joined: 27 Nov 2008
Posts: 7

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 4:04 am     Reply with quote

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.
tom.ayars



Joined: 23 Jun 2008
Posts: 14

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 9:56 am     Reply with quote

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?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 12:05 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group