This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357-EP: interrupt handler

Part Number: TMS570LC4357-EP


Tool/software: Code Composer Studio

Hello,

I am toggling a GIO pin, and generating interrupt at the rising edge. I am able to see that the interrupt flags are getting set, but the ISR is not getting serviced. I am not able to resolve why the ISR (&gioHighLevelInterrupt in this case) is not getting serviced.

Please help me resolve the issue.

Do I have to configure any settings in the core registers? If so, how to do it?

Below is the code snippet of main function:

int main(void)
{
/* USER CODE BEGIN (3) */
/* USER CODE END */
    _enable_interrupt_ ();

       gioInit();  //GIO initialization

       gioEnableNotification(gioPORTA, 4);  //enables interrupt for GIOA 4

       vimEnableInterrupt(9, 0);  //enables interrupt for the selected channel

       vimChannelMap(2, 9, &gioHighLevelInterrupt); //maps the request to the respective channel

       gioToggleBit(gioPORTA, 6); //toggle GIOA 6

       while (1)
       {
           ;
       }

    return 0;
}

Please let me know if I have missed anything.

Regards

Sanjana V

  • Sanjana,

    One obvious issue is that you enabled interrupt on A4 not A6.


    gioEnableNotification(gioPORTA, 4); //enables interrupt for GIOA 4

    gioToggleBit(gioPORTA, 6); //toggle GIOA 6


    You may also doublecheck the interrupt request # from GIO module. I "guess" the request should be 9, and the channel can be 2-95, so your arguments may be swapped.
    vimChannelMap(2, 9, &gioHighLevelInterrupt); //maps the request to the respective channel

    Also, should better to install ISR first before enabling interrupts.

    Joe

  • Hello Sanjana,

    1. To generate interrupt at GIOA[4], you need to feed an input to GIOA[4]. You can wire GIOA[6] to GIOA[4] based on your configuration (toggling GIOA[6])

    2. To configure GIOA[4] interrupt to use HIGH level. The default is LOW level.

        gioREG->LVLSET = (uint32)((uint32)1U << 4U)   /* Bit 4 */

  • Hi Joe,

    Thanks for the reply

    I swapped the VIM arguments and it worked.

    Thank you once again :)

    Regards

    Sanjana V

  • Hi Wang,

    Thank you for the reply

    Input was fed to GIOA[4] from GIOA[6] , where both the pins are wired.

    High level interrupt was configured on GIOA[4].

    I had went wrong in arguments passed to the VimMap function , and now the issue is resolved :)

    Regards

    Sanjana V