View previous topic :: View next topic |
Author |
Message |
d00dajo
Joined: 20 Jul 2004 Posts: 34
|
High/Low interrupts in CCS compiler |
Posted: Tue Mar 22, 2005 2:00 am |
|
|
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
|
|
Posted: Tue Mar 22, 2005 3:34 am |
|
|
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
|
|
Posted: Tue Mar 22, 2005 3:46 am |
|
|
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!
Thanks future. |
|
|
Ttelmah Guest
|
|
Posted: Tue Mar 22, 2005 5:54 am |
|
|
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
|
|
Posted: Tue Mar 22, 2005 6:21 am |
|
|
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
|
|
Posted: Tue Mar 22, 2005 6:39 am |
|
|
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
|
Clarification |
Posted: Tue Mar 22, 2005 6:47 am |
|
|
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 |
|
|
|