I don't know why it doesn't work:
Chip_PININT_Init(LPC_GPIO_PIN_INT); //--> CLOCK
//PIN INTERRUPT
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 11, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 12, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));
/* Configure GPIO pin as input */
Chip_GPIO_SetPinDIRInput(LPC_GPIO, 0, 11);
Chip_GPIO_SetPinDIRInput(LPC_GPIO, 0, 12);
//CREO QUE NO HACE FALTA
//Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_PININT); /* Enable PININT clock */
//Chip_SYSCTL_PeriphReset(RESET_PININT); /* Reset the PININT block */
Chip_SWM_DisableFixedPin(SWM_FIXED_ADC1_3);
Chip_SWM_DisableFixedPin(SWM_FIXED_DAC_OUT);
//----------------->>0 INT
Chip_INMUX_PinIntSel(0, 0,11); //ON_OFF PUSH LPC_INMUX->PINTSEL[pintSel] = (portNum * 32) + pinNum;
//LPC_INMUX->PINTSEL[0] = 0x0B;
//----------------->>1 INT
Chip_INMUX_PinIntSel(1, 0,12); //LINK_PUSH
/*
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, 0x00000003); //POR FLANCO ISEL para INT_0/INT_1
LPC_GPIO_PIN_INT->SIENR |= 0x00000003;
LPC_GPIO_PIN_INT->IENR |= 0x00000003;
LPC_GPIO_PIN_INT->SIENF |= 0x00000003;
LPC_GPIO_PIN_INT->IENF |= 0x00000003;
*/
/* Configure channel interrupt as edge sensitive and falling edge interrupt */
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(0));
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(0));
Chip_PININT_EnableIntLow(LPC_GPIO_PIN_INT, PININTCH(0));
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(1));
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(1));
Chip_PININT_EnableIntLow(LPC_GPIO_PIN_INT, PININTCH(1));
/* Enable PIN EXT 0/1 interrupt */
NVIC_ClearPendingIRQ(PIN_INT0_IRQn);
NVIC_EnableIRQ(PIN_INT0_IRQn);
NVIC_ClearPendingIRQ(PIN_INT1_IRQn);
NVIC_EnableIRQ(PIN_INT1_IRQn);
Hello Juan,
I went ahead and checked both pin interruptions using an example code which toggles the led on the board when the interruption occurs.I've attached the folder which contains the example so you can take a look.
I got this example from the LPCOpen Package for the LPC1549 which should work for the LPC1517. The following link shows you how to import the examples for MCUXpresso IDE:
https://www.nxp.com/video/mcuxpresso-ide-using-lpcopen-examples:MCUXPRESSO-IDE-USING-LPCOPEN
The two parameters that I changed to 11 & 12 which are located in the "pininit.c" file, are the following:
#define TEST_INPUT_PIN 11/* GPIO pin number mapped to PININT */
#define TEST_INPUT_PIN_BIT 11
Hope this helps.
Have a great day!
Sabina