I have been trying to detect when a signal goes from low to high (0 to 3.3 V) using the MSP432 button example, in the code below I am using P6.4 to detect this, the problem is that for some reason the program only triggers the interrupt (PORT6_IRQHandler) when the input signal goes from high to low, even thought I configured the resistor as pull down or pull up (neither of them allow me to detect when the signal goes from low to high). Does someone know's why?
Note: The ISR PORT6_IRQHandler turns on and off P1.0, the problem can be better observed in the image below where the input signal and the output pin where monitored.
/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
int a = 0 ;
uint32_t status,status2;
int main(void)
{
WDT_A_holdTimer();
GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P6, GPIO_PIN4);
GPIO_clearInterruptFlag(GPIO_PORT_P6, GPIO_PIN4);
GPIO_enableInterrupt(GPIO_PORT_P6, GPIO_PIN4);
Interrupt_enableInterrupt(INT_PORT6);
SysCtl_enableSRAMBankRetention(SYSCTL_SRAM_BANK6);
Interrupt_enableMaster();
while (1)
{
PCM_gotoLPM3();
}
}
/* GPIO ISR */
void PORT6_IRQHandler(void)
{
a++;
status = GPIO_getEnabledInterruptStatus(GPIO_PORT_P6);
GPIO_clearInterruptFlag(GPIO_PORT_P6, status);
if(status == 16)
{
GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);
}
}
Thanks

