Hi,
I am working with TMS320VC5416. I want to use external interrupt INT0, INT1, INT2.
I have check my code in simulator, when I set the IFR bit '0' (IFR = 0x0001), it does not jump to ISR. It jump to 0xFFC1 and INTM bit is also goes to 1.
Here is my code.
/******************Code**********************/
volatile unsigned int *IMR = (volatile unsigned int *) 0x0000;
volatile unsigned int *IFR = (volatile unsigned int *) 0x0001;
void EXT_INT_ISR();
/****************Interrupt Handler**********************/
interrupt void EXT_INT_ISR()
{
if( (*IFR & 0x01)==0x01)
{
*IFR &= 0xFE;
}
if( (*IFR & 0x02)==0x02 )
{
*IFR &= 0xFD;
}
if( (*IFR & 0x04)==0x04 )
{
*IFR &= 0xFB; //
}
}
/***********************Main*******************/
void main(void)
{
unsigned short temp=0;
unsigned char counter=0;
*IMR= 0x07;
asm(" RSBX INTM ");
asm(" nop");
asm(" nop");
while(1);
}
/**********************Linker Command File*******************************/
-c
-l C:\CCStudio_v3.3\C5400\cgtools\lib\rts_ext.lib
MEMORY {
PAGE 0: /* program memory */
PROG_RAM : origin = 0x0080, length = 0x7F80
/* boot interrupt vector table location */
VECTORS : origin = 0xFF80, length = 0x80
PAGE 1:
DATA_RAM : origin = 0x8000, length = 0x8000
} /* MEMORY */
SECTIONS {
.text > PROG_RAM PAGE 0
.switch > PROG_RAM PAGE 0
.cinit > PROG_RAM PAGE 0
.vectors > VECTORS PAGE 0
.data > DATA_RAM PAGE 1
.bss > DATA_RAM PAGE 1
.const > DATA_RAM PAGE 1
.sysmem > DATA_RAM PAGE 1
.stack > DATA_RAM PAGE 1
}
I think, I am missing some thing in the ISR. Please Let me know if there is any issue in ISR.
void EXT_INT_ISR();
/****************Interrupt Handler**********************/
interrupt void EXT_INT_ISR()
{
if( (*IFR & 0x01)==0x01)
{
*IFR &= 0xFE;
}
if( (*IFR & 0x02)==0x02 )
{
*IFR &= 0xFD;
}
if( (*IFR & 0x04)==0x04 )
{
*IFR &= 0xFB; //
}
}
When I am running this code through XDS510 usb emulator. When I give the interrupt on INT0 through Keypad, which is reflected by IFR = 0x0001. Now the cursor does not jump anywhere, it simply follow code.
Please let me know, if there is any issue in enabling interrupt or writing ISR.???????. Also describe how to write ISR for TMS320VC5416.
Thanks.
Regards
Rafaqat