sohel ,
Now is 05:35PM Sunday here. Yes take your time.
I just switch to 18F4550 and read the ERRATA for the 4550; it suggest:
This is from 4550 errata:
PIC18F2455/2550/4455/4550
The code segment shown in Example 2
demonstrates the work around using the C18
compiler:
#pragma interruptlow MyLowISR
void MyLowISR(void)
// Handle low priority interrupts.
// Although MyHighISR is a high priority interrupt, use interruptlow pragma so that
// the compiler will not use retfie FAST.
#pragma interruptlow MyHighISR
void MyHighISR(void)
// Handle high priority interrupts.
#pragma code highVector=0x08
void HighVector (void)
_asm goto MyHighISR _endasm
#pragma code /* return to default code section */
#pragma code lowVector=0x18
void LowVector (void)
_asm goto MyLowISR _endasm
#pragma code /* return to default code section */
See how Microchip suggest using both #pragma interruptlow for HI and LOW.
I used this and the Low-Pri interrupt work but the Hi-Pri int is not working. There is only one interrupt vector work at one time. I think, it has something to do with the STACK when interrupt returns. I thing there are working code somewhere and I know people working on this before me.
It needs sometimes to get the code working. I am passion person.
Tom