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 support@ccsinfo.com

High/Low interrupts in CCS compiler

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



Joined: 20 Jul 2004
Posts: 34

View user's profile Send private message Send e-mail

High/Low interrupts in CCS compiler
PostPosted: Tue Mar 22, 2005 2:00 am     Reply with quote

Hi,

I am currently working wit the PIC18F4680 microcontroller. In the errata one finds that the "high priority" interrutps does not work as intended (the RET. FAST instruction is flawed). The workaround suggested is to use only the low priority interrupt vector. I have worked with the C18 compiler, where one simply states the high/low priority. I dont seem to find a corresponding command in the CCS compiler. That is, I want to define all interrupts to be of "lowpriority" and NOT use the fast return command. The closest thing I have found is the #priority pragma, but that does not really do it. Any suggestions?

//Daniel.
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Tue Mar 22, 2005 3:34 am     Reply with quote

By default, all interrupts are low priority.

You must add "FAST" to the interrupt declaration to make it high priority.

#INT_EXT0 FAST
void int_handler(void)
{
}
d00dajo



Joined: 20 Jul 2004
Posts: 34

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 22, 2005 3:46 am     Reply with quote

future wrote:
By default, all interrupts are low priority.

You must add "FAST" to the interrupt declaration to make it high priority.

#INT_EXT0 FAST
void int_handler(void)
{
}



Great! Very Happy
Thanks future.
Ttelmah
Guest







PostPosted: Tue Mar 22, 2005 5:54 am     Reply with quote

Beware though, that as soon as you do this, it becomes _your_ responsibility to handle saving all the registers. You need to look at the assembler generated for any routines you call, and arrange your own save and restore for these...

Best Wishes
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Mar 22, 2005 6:21 am     Reply with quote

Ttelmah wrote:
Beware though, that as soon as you do this, it becomes _your_ responsibility to handle saving all the registers. You need to look at the assembler generated for any routines you call, and arrange your own save and restore for these...

Best Wishes
This is true if you want to use the High priority interrupts (FAST keyword), but he wants to use the Low priority interrupts in which case the compiler saves all registers for you.
Ttelmah
Guest







PostPosted: Tue Mar 22, 2005 6:39 am     Reply with quote

ckielstra wrote:
Ttelmah wrote:
Beware though, that as soon as you do this, it becomes _your_ responsibility to handle saving all the registers. You need to look at the assembler generated for any routines you call, and arrange your own save and restore for these...

Best Wishes
This is true if you want to use the High priority interrupts (FAST keyword), but he wants to use the Low priority interrupts in which case the compiler saves all registers for you.

Er.
He was specifically asking how to get the 'high priority' interrupts, and had been told to use the 'FAST' keyword. He does not 'want to use the low priority interrupts'. This is what he is already doing, and complaining that it is not giving the high priority access...

Best Wishes
d00dajo



Joined: 20 Jul 2004
Posts: 34

View user's profile Send private message Send e-mail

Clarification
PostPosted: Tue Mar 22, 2005 6:47 am     Reply with quote

Ttelmah wrote:
ckielstra wrote:
Ttelmah wrote:
Beware though, that as soon as you do this, it becomes _your_ responsibility to handle saving all the registers. You need to look at the assembler generated for any routines you call, and arrange your own save and restore for these...

Best Wishes
This is true if you want to use the High priority interrupts (FAST keyword), but he wants to use the Low priority interrupts in which case the compiler saves all registers for you.

Er.
He was specifically asking how to get the 'high priority' interrupts, and had been told to use the 'FAST' keyword. He does not 'want to use the low priority interrupts'. This is what he is already doing, and complaining that it is not giving the high priority access...

Best Wishes


Hi all,

Just to clear this out. No, I DONT want to use fast interrupts, because there is an error in the silicon which makes the fsat return from interrupt flawed (sabotages values of certain registers).
I was unsure whether or not the compiler automatically used fast or normal interrupt handling. It is all sorted out now and the cmpiler actually did what I wanted to do per default.

//Daniel
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