Using Nmi Pin as a GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Nmi Pin as a GPIO

1,103 Views
KevinBRANCOSIMOES
Contributor I

Hello and thanks in advance for your assistance.

Actually, I am trying to connect a P36S103, a Rotary DIP switch with 15 positions to 4 GPIO Inputs of my MCU. 

At the beggining of my program, a LED is supposed to blink and informations are supposed to be exchanged via UART.

Usually the program works perfectly. But I have noticed that when the switch is on positions 2 - 3 - 6 - 7 - A (10) - B (11) - E (14) - F(15), the LEDs doesn't blink and the UART doesn't work.

I have noticed that all those positions used my PTB5 Input that is a NMI Input. I have tried many things to disable this NMI option but it still doesn't work. Do someone have an Idea ?

 

I am using MCUXpresso IDE v11.5.1_7266 and my Mcu is a mkl03z16vfk4.

Capture.JPG              Capturedf.JPG

0 Kudos
Reply
4 Replies

1,097 Views
KevinBRANCOSIMOES
Contributor I

I forgot to say that I am using a PE Multilink Universal to debug my program. When it is connected, the program works even with the positions 2 - 3 - 6 - 7 - A (10) - B (11) - E (14) - F(15) but as soon as I try to flash Program then disconnect it. I have the same problem as before, no LED and no UART

0 Kudos
Reply

1,088 Views
ErichStyger
Specialist I

Can you check if you are able to disable the NMI functionality in the flash config of your device, similar to what is described in https://mcuoneclipse.com/2020/06/09/disabling-nmi-non-maskable-interrupt-pin/

?

0 Kudos
Reply

1,086 Views
KevinBRANCOSIMOES
Contributor I

I tried to use the code provided in the site but mcu is telling me that some of those mask aren't declared so I deleted those.

dfd.JPG

Now my program is working but the LEDs that are supposed to blink instantly work after a few seconds. I wonder if its normal ?

Thanks a lot for your help

 

0 Kudos
Reply

1,084 Views
ErichStyger
Specialist I

The KL03Z has a ROM bootloader which runs first. Have you configured a timeout?

See https://mcuoneclipse.com/2017/07/12/getting-started-rom-bootloader-on-the-nxp-frdm-kl03z-board/

As for the FOPT: you need to check the bits of your device, just in case.

I hope this helps,

Erich

0 Kudos
Reply