Hi Javier Cardona,
Please check your NMI pin, did you add external 4.7K to 10K pull-up resistor in the NMI pin?
Because the internal pull-up is weak, please add the external pull up.
Besides, please also check your NMI wave when the problem happens, whether the button really pull down the NMI pin to ground.
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------