2023-05-30 11:27 AM - edited 2023-11-20 04:20 AM
Hi all,
I'm using STM32L562VETQ
my question is:
can i delay the reset for about 20ms when pressing the NRST pin ?
i want to give LED-Indication for the device reset.
in other words, can the reset -that comes from the NRST pin- be delayed for a specific amount of time ?
and if so, how can i read the state of the NRST pin so that to detect that the user has pressed it ?
Solved! Go to Solution.
2023-05-30 12:43 PM
Correct.
But you could design an external reset circuitry by delaying the low pulse at NRST accordingly.
With a few logic gates and an RC element, this should be feasible. For example, you could define the reset as active high, switch the reset switch to VDD, charge a capacitor with it via a resistor (RC low-pass) and then connect the output to an inverting Schmitt trigger, whose output is in turn connected to NRST.
Attention: the output of the logic gate / Schmitt trigger must either be open-drain or converted to something similar with a Schottky diode.
2023-05-30 11:57 AM
How'd that work?
You can add code in ResetHandler() to configure and set GPIO pins, and spin there for a while.
An MCP-120 type POR circuit could hold the NRST low for several hundred ms, and LED could use that as it's ground side, to illuminate briefly if triggered. Perhaps some more exotic reset chips available.
2023-05-30 12:03 PM
thanks for your reply.
so i can't delay the reset of the NRST pin. that reset will get executed immediately right ?
2023-05-30 12:43 PM
Correct.
But you could design an external reset circuitry by delaying the low pulse at NRST accordingly.
With a few logic gates and an RC element, this should be feasible. For example, you could define the reset as active high, switch the reset switch to VDD, charge a capacitor with it via a resistor (RC low-pass) and then connect the output to an inverting Schmitt trigger, whose output is in turn connected to NRST.
Attention: the output of the logic gate / Schmitt trigger must either be open-drain or converted to something similar with a Schottky diode.
2023-05-30 12:56 PM
ok that's helpful
thanks