AnsweredAssumed Answered

lpc1517 pinint

Question asked by Juan Moya on Feb 6, 2019
Latest reply on Feb 7, 2019 by Sabina Bruce

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);

Outcomes