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.








