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/MSP432P401R: Missing rising edge interrupts

Part Number: MSP432P401R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: Code Composer Studio

The drivers configured by .sysconfig appear to be missing most rising edges for interrupts.  This is a BIG problem.

I have configured an input pin for interrupts on both edges using .sysconfig and TI-RTOS.  Pin configuration below:

My initialization code is as follows:

void initSensor(Event_Handle healthEvent)
{
    Event_Params eParams;
    Task_Params taskParams;

    /* set up the event for handling I/O changes */
    Event_Params_init(&eParams);
    Event_construct(&eventIopinStruct,&eParams);
    eventIopin = Event_handle(&eventIopinStruct);

    /* enable the GPIO interrupts */
    GPIO_enableInt(HAPPYn);
    GPIO_enableInt(SADn);
    GPIO_enableInt(TUBEOUT);
    GPIO_enableInt(DOOROPEN);

    /* start the 32bit timer (used to time button presses */
    TIMER32_1->LOAD = 0xffffffff; /* we are just counting down continuously */
    /* Wrapping mode, 32 bits, divide by 1 prescale, interrupts disabled, free running, enabled */
    TIMER32_1->CONTROL = TIMER32_CONTROL_SIZE | TIMER32_CONTROL_ENABLE;

    /* start the sensor task */
    Task_Params_init(&taskParams);
    taskParams.stack = senTaskStack;
    taskParams.stackSize = SENSOR_TASK_STKSZ;
    taskParams.arg0 = (UArg) healthEvent;
    taskParams.priority = SENSOR_TASK_PRI;
    Task_construct(&senTask,(Task_FuncPtr)sensorTask,&taskParams, NULL);
}

My callback function is as follows:

void gpioCallback(uint_least8_t index)
{
    switch (index)
    {
    case HAPPYn:
        GPIO_toggle(MOCK_HAPPY);
        if (GPIO_read(HAPPYn) == 0)
        {
            GPIO_write(FOLLOW_HAPPY,0);
            Event_post(eventIopin,HAPPY_PRESSED);
        }
        else
        {
            GPIO_write(FOLLOW_HAPPY,1);
            Event_post(eventIopin,HAPPY_RELEASED);
        }
        break;
    case SADn:
        Event_post(eventIopin,SAD_CHANGED);
        break;
    case TUBEOUT:
        Event_post(eventIopin,TUBE_CHANGED);
        break;
    case DOOROPEN:
        Event_post(eventIopin,DOOR_CHANGED);
        break;
    default:
        break;
    }
}

My button is a pushbutton, relying on the pull up resistor in the MSP432 port. I have configured two GPIOs to illustrate what is going on in my interrupt function.
It appears that the interrupt function catches all falling edges but misses most (but not all rising edges). Look at this capture below, Button is the button input,
Mock Follow should toggle on both rising and falling edges and Follower will go high on a rising edge interrupt and low on a falling edge interrupt.

Looking at my first capture below note that a rising edge is only seen at the 3 second mark. The next figure shows the lag between the event change and servicing the interrupt is about 35 uSec.

The third figure is a zoom in of the area near the 1.25 Sec mark. You can see that even though it looks like we responded to a rising edge, it was actually detecting the falling edges of the button bounce.

The fourth figure is a zoom in of the area where the rising edge was finally noticed.

If it makes a difference, the hardware glitch filter in the CPU config is turned on.




  • It looks like the last part of my post got mangled, here it is:

    My button is a pushbutton, relying on the pull up resistor in the MSP432 port. 

    I have configured two GPIOs to illustrate what is going on in my interrupt function.It appears that the interrupt function catches all falling edges but misses most (but not all rising edges). 

    Look at this capture below, Button is the button input, Mock Follow should toggle on both rising and falling edges and Follower will go high on a rising edge interrupt and low on a falling edge interrupt.

    Looking at my first capture below note that a rising edge is only seen at the 3 second mark. 

    The next figure shows the lag between the event change and servicing the interrupt is about 35 uSec.

    The third figure is a zoom in of the area near the 1.25 Sec mark.  You can see that even though it looks like we responded to a rising edge, it was actually detecting the falling edges of the button bounce.

    The fourth figure is a zoom in of the area where the rising edge was finally noticed.If it makes a difference, the hardware glitch filter in the CPU config is turned on.


  • Hi Mike,

    Thanks for your detailed post. The MSP432P401R does not support detecting interrupts on both edges - only low-to-high or high-to-low transitions. I'm not sure why SysConfig doesn't check that compatibility, so I'll report this and see if that check can be added.

    MSP432P401R: GPIO INTERRUPTION: "GPIO_CFG_IN_INT_BOTH_EDGES"

    Regards,

    James