sea-picro icon indicating copy to clipboard operation
sea-picro copied to clipboard

How does the reset/boot circuit work?

Open girishji opened this issue 2 years ago • 5 comments

girishji avatar Sep 27 '22 18:09 girishji

Hi,

The README explains its function per below.

When tapped for less than 500ms will reset the board, but when held for 500ms or more will jump into the bootloader.

You can also find the LTspice simulation in the simulation folder.-------- Original Message -------- On 28 Sept 2022, 04:17, girish wrote:

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

joshajohnson avatar Sep 27 '22 21:09 joshajohnson

I understand the usage. Is there a write up somewhere (reference) how this circuit works in principle? It is not intuitive how these mosfet switches cause delay.

girishji avatar Sep 28 '22 06:09 girishji

R2, R3, and Q2 are to invert the active low signal of a pro micro for backwards compatibility. I have since realised that Q2 and R2 can be removed and SW1 placed where Q2 is.

R1 pulls nRST (RUN) high to enable the chip, and Q1 pulls it low to got into reset when Q2 turns off / SW1 is pressed.

For the delay circuit we need Q3 as the BOOT pin is also flash chip select, so if we had capacitance on that line the flash would never work. R4 is probably not needed, but I never like pulling anything directly to ground. The delay circuit could be made with 3 parts instead of 5, but I wanted to keep BOM lines low.

Q4 (could sub for a diode) is to ensure the gate of Q3 stays charged once you release the button - ensuring reset comes up before BOOT.

joshajohnson avatar Sep 28 '22 12:09 joshajohnson

Is the RC delay circuit tested with real components (not simulation)? RC delay is a good idea for this application. When SW is not pressed it barely wastes any current (20 uA through 5k+3*51k). Quite efficient.

girishji avatar Sep 29 '22 10:09 girishji

I've manufactured and tested over 100 boards, so yes it's proven in real life.

It draws 600uA in the unpressed state.

joshajohnson avatar Sep 29 '22 10:09 joshajohnson