This is my abortive attempt to get an interrupt on the rising or falling edge of Port D bit 0:
SIM->SCGC5 |= SIM_SCGC5_PORTD_MASK; // Enable Clock to Port D //
PORTD->PCR[0] = PORT_PCR_MUX(1); // Make bit 0 of port D available for GPIO
PORTD->PCR[0] |= PORT_PCR_IRQC(0x0B);
PORTD->PCR[0] |= PORT_PCR_ISF(1); // clear interrupt flag
PTD->PDDR &= 0xFFFFFFFE; // Make D0 an input
Hi Sam,
Please refer the gpio input_interrupt example in SDK_2.2.1_MKL17Z256xxx4. (...\SDK_2.2.1_MKL17Z256xxx4\boards\frdmkl43z\driver_examples\gpio\input_interrupt)
You can download the SDK_2.2.1_MKL17 package refer Generating a downloadable MCUXpresso SDK v.2 package.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
I have made a short video explaining GPIO port interrupts on the KL17/27: https://youtu.be/CubinvMuTwU
You can compare with your settings (I expect that you have just not enabled the interrupt in the NVIC) to solve the issue.
If you want to try working with the KL27/KL17 simulator it is available as open source at the links below. It can save a lot of time in real project developments.
Regards
Mark
http://www.utasker.com/kinetis.html
http://www.utasker.com/kinetis/FRDM-KL27Z.html
http://www.utasker.com/kinetis/Capuccino-KL27.html