AnsweredAssumed Answered

FRDM-K64 and GPIO configuration as interrupt input

Question asked by Nadine Sueur on Dec 22, 2016
Latest reply on Dec 22, 2016 by Robin_Shen

Hi,

 

I'm using a FRDM-K64 board with SDK_2.0 and KDS 3.1.0.

I try to configure the pin PTC3  as an input interrupt. Here after, you'll find the initialization code that I use:

 

/* PTC3 - Pin 16 SLP_TR Pin */
#define BOARD_SLP_TR_PORT          PORTC
#define BOARD_SLP_TR_IRQ              PORTC_IRQn
#define BOARD_SLP_IRQ_HANDLER PORTC_IRQHandler
#define BOARD_SLP_TR_GPIO           GPIOC
#define BOARD_SLP_TR_GPIO_PIN   3

 

PORT_SetPinMux(PORTC, BOARD_SLP_TR_GPIO_PIN, kPORT_MuxAsGpio);       /* PTC3 */

GPIO_PinInit(BOARD_SLP_TR_GPIO, BOARD_SLP_TR_GPIO_PIN, &in_config);
NVIC_SetPriority(BOARD_SLP_TR_IRQ, 15);
EnableIRQ(BOARD_SLP_TR_IRQ);
PORT_SetPinInterruptConfig(BOARD_SLP_TR_PORT, BOARD_SLP_TR_GPIO_PIN, kPORT_InterruptEitherEdge);

 

The program fails as soon as the GPIO pin state is modified. It' looks like I never enter in the interrupt handler.

 

Any help is welcome. 

Thanks in advance

 

Nadine,

Outcomes