how do i enable an interrupt from a bit of a port on the MKL1724 when it is in GPIO mode?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how do i enable an interrupt from a bit of a port on the MKL1724 when it is in GPIO mode?

1,150件の閲覧回数
samadair
Contributor I

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

0 件の賞賛
返信
2 返答(返信)

1,002件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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)

gpio_input_interrupt.png

SDK_2.2.1_MKL17Z256xxx4.png
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!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

1,002件の閲覧回数
mjbcswitzerland
Specialist V

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

0 件の賞賛
返信