I am using MK22FN1M0AVLQ12 for my project. Is there any Non-Maskable interrupt available in the microcontroller?. Can i configure any of the port pins in the microcontroller as interrupt?. How many pins can be configured as NMI?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I am using MK22FN1M0AVLQ12 for my project. Is there any Non-Maskable interrupt available in the microcontroller?. Can i configure any of the port pins in the microcontroller as interrupt?. How many pins can be configured as NMI?

849 次查看
sarath831989
Contributor I

I am using MK22FN1M0AVLQ12 for my project. I need three hardware interrupt pins to be used. How many Hardware interrupt pins are available on MK22FN1M0AVLQ12?. 

Can I configure any of the port pins as Hardware interrupt pins?

0 项奖励
回复
1 回复

725 次查看
egoodii
Senior Contributor III

Yes, all the GPIO can be configured as interrupt-sources, on various events.  Look into the port-control block.  Each port has its own vector for all pins in that port.  These interrupts can be EFFECTIVELY NMI if you make them the highest priority (zero) and all other interrupt actions at a lower priority, AND never use the 'global disable' macro---use set and clear of BASEPRI to 'disable' all LOWER interrupt levels when necessary.  This is how I run...

extern uint32_t Port_IntsDisableCount; // count of performed disables

#define DISABLE_LOW_INT()    Port_IntsDisableCount++;\
                  __set_BASEPRI( 1 << (8-ARM_INTERRUPT_LEVEL_BITS) ); //All SPI-device interrupts on Level 1, disable them (and lower)
#define ENABLE_LOW_INT()      if(--Port_IntsDisableCount==0) \
                  __set_BASEPRI( 0 );      //If we get back to 'base level count', enable all interrupts

Otherwise, there is ONE pin you can make the 'true NMI'---the pin also functioning as PortA(4):  ALT#7 is NMI, and that is the default fn for that pin.  JTAG is the default for several other PortA pins...

0 项奖励
回复