KEAZN16 NMI problem at startup

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

KEAZN16 NMI problem at startup

Jump to solution
2,364 Views
snipex94
Contributor I

Hi!

As said in the title I have a problem with the !NMI pin at startup. It is used for SPI_MISO communication.

It's causing problems when I turn on the power supply. The IC that it's communicating with apparently holds down the pin and the NMI gets asserted at startup which causes the uC to lockup (reset won't help). 

I tried with a pullup resistor but it seems to deassert it to late.

Does anybody know a way around this problem? Can I disable the NMI pin permanently (I couldn't find anything in the datasheet) ?

Tags (3)
0 Kudos
1 Solution
1,742 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Customer,

    It is not the problem, it can be said just the KEAZN16 feature, not only the KEA have this feature, KE series also have this feature.

    NMI pin can't be disabled permanently!

     From the reference manual, you also can find this feature:

pastedImage_2.png

Actually, even you disable the function in SIM_SOPT[NMIE], but take care, this is just use the code to disable it.

But after reset, the PTB4 already be NMI function in default.

So, if you want to use the NMI pin as the other function. You must make sure during the reset, you should keep the NMI pin to high in the outside circuit.

Actually, I also don't recommend the customer to use the SWD and NMI pin to other functions, just for this reason.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
6 Replies
1,742 Views
kylewang
Contributor I

Hi, i am developing KE04 by IAR and have same problem just like you.

In KE series,even if you disable NMI function in your code, still it goes to NMI interrupt service routine all the time

and you setting codes becomes unreachable.

so just add SIM->SOPT0 &= ~SIM_SOPT0_NMIE_MASK; in  NMI interrupt service routine "default_isr(void)" (for example).

everything should be fine.

BR,

humblekyle

0 Kudos
1,742 Views
fortunely
Contributor III

Hi Kyle Wang, 

It seems that NMI pin can not be pulled down when power on, otherwise, NMI interrupt will occur.
I do not know whether it works if I configure NV FOPT by modifying flash configuration section "cfmconfig" just like here https://community.nxp.com/thread/350133?commentID=498526#comment-498526 , instead of configuring SIM->SOPT.

0 Kudos
1,742 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Martin,

     KEA series is special, the NMI pin will still be the NMI function when you power on the chip even you already disable it, so, it's better to keep the NMI pin high during power on.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,742 Views
kisvegabor
Contributor I

Hi!

My problem was near the same. We have an accelerometer connected to NMI pin via SPI. At startup its power supply was turned off and the IC pulled down the NMI pin.

To solve this I added the NMI interrupt handler and enabled the power supply there: 

void NMI_Handler(void)
{
supply_on();
}

When the accelerometer get power supply it set its pin to HighZ and released the NMI pin.

I hope it helps!

Gabor

0 Kudos
1,742 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Gabor Kiss-Vamosi,

    Thanks for your experience sharing.

    Actually, just one point, if the NMI pin is low, it will enter NMI handler  during power on, even you disable it.

   This is the KE, KEA series feature need to take care, K, KL series don't have this feature.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,743 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Customer,

    It is not the problem, it can be said just the KEAZN16 feature, not only the KEA have this feature, KE series also have this feature.

    NMI pin can't be disabled permanently!

     From the reference manual, you also can find this feature:

pastedImage_2.png

Actually, even you disable the function in SIM_SOPT[NMIE], but take care, this is just use the code to disable it.

But after reset, the PTB4 already be NMI function in default.

So, if you want to use the NMI pin as the other function. You must make sure during the reset, you should keep the NMI pin to high in the outside circuit.

Actually, I also don't recommend the customer to use the SWD and NMI pin to other functions, just for this reason.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos