View previous topic :: View next topic |
Author |
Message |
Regas
Joined: 08 Jan 2010 Posts: 8
|
Fast isr routine with PCD compiler |
Posted: Fri Jan 08, 2010 6:59 am |
|
|
I have to write an extreme fast interrupt routine for dsPIC30 Chip using pcd compiler.
No registers are changed and the top int level in this project is used.
The keyword fast can then be used for the next lower int level.
I tried the following code:
Code: |
#bit INT1EP = 0x82.1
#bit NSTDIS =0x80.15
#bit INT1IF = 0x86.0
#word IPC4 =0x9C
#rom 0x34 = {0x000100}// Int Vector INT1
#org 0x100, 0x110
Void Ext1_isrTest(void){
output_high(_Freig_V);
VKurzschluss =1;
output_high(LED_G2);//Test
INT1IF =0;
#ASM
RETFIE
#ENDASM
}
initial routine:
INT1EP =1; //Hi to Lo flanke
bit_set(IPC4,0); //priority level 5
enable_interrupts(INT_EXT1 );
enable_interrupts(INT_ADC1); //Default priority level 4
NSTDIS =0; //Interrupt nesting is enabled
|
The compiler will generate an error, because writing to rom location below 0x100 is not allowed.
How can I place an pointer address to ram location 0x34?
Or is there an other possibility to write own isr routine? |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
Re: Fast isr routine with PCD compiler |
Posted: Fri Jan 08, 2010 8:17 am |
|
|
Regas wrote: |
I tried the following code:
|
No you didn't, because that will not compile, I know it will not compile and I have not even tried to compile it.
Post something that does compile which includes CCS version numbers and FUSE settings.
Remove :-
Code: |
#rom 0x34 = {0x000100}// Int Vector INT1
|
Change
Code: |
#org 0x100, 0x110
Void Ext1_isrTest(void){
|
Try
Code: |
#INT_EXT1 FAST
void Ext1_isrTest(void){
|
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Jan 08, 2010 9:26 am |
|
|
In a short, PCD is missing all means, also at the assembler level, to do what you are trying to achieve, e.g. assign
interrupt vectors to arbitrary functions. Some special solutions, also related to bootloader programming are
effectively blocked this way.
But #INT_XXX FAST works and should be sufficient for the intended purpose. |
|
|
|