I am new to the KW36
I am using the FDRM KW36 Demo Board
I have configured PTC2 to be an interrupt pin
I have enabled the interrupt - EnableIRQ(PORTB_PORTC_IRQn);
I have defined the ISR - void PORTB_PORTC_IRQHandler(void)
But it does not work
Anny suggestions
Hi,
I am not sure if you are working on a simple project or if you are using a Bluetooth LE example.
However, you could look at the GPIO interrupt driver example.
\SDK_KW36\boards\frdmkw36\driver_examples\gpio\input_interrupt
Please look at the pin 18 configuration below.
PORT_SetPinMux(PORTB, PIN18_IDX, kPORT_MuxAsGpio); /* PORTB18 (pin 23) is configured as PTB18 */
PORTB->PCR[18] = ((PORTB->PCR[18] &
(~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK))) /* Mask bits to zero which are setting */
| PORT_PCR_PS(0x01u) /* Pull Select: 0x01u */
| PORT_PCR_PE(0x01u) /* Pull Enable: 0x01u */
| PORT_PCR_SRE(0x01u) /* Slew Rate Enable: 0x01u */
);
Also, to enable the ISR.
/* Init input switch GPIO. */
PORT_SetPinInterruptConfig(BOARD_SW_PORT, BOARD_SW_GPIO_PIN, kPORT_InterruptFallingEdge);
EnableIRQ(BOARD_SW_IRQ);
GPIO_PinInit(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, &sw_config);
For the Bluetooth LE example look at the Keyboard.c file and look at the void KBD_Init( KBDFunction_t pfCallBackAdr )function, it is implementing the GPIO initialization and how is register the callback for the specific events.
Regards,
Mario
I takes 30 seconds from pressing the button for the debug "Button Pressed" to appear on serial port
Why so slow ??
I have written the following code