Questions tagged [reset]

Use this tag for discussing resetting the processor.

What happens at reset

When a processor is powered on, it goes through a "reset" process, which means that:

  • The hardware is set to a defined initial configuration (eg. all pins to inputs)
  • The program counter is set to either address zero (the start of your program code), or the address of the bootloader code, depending on how the processor fuses are set.
  • The program then starts running.

How does a reset occur?

Resets can be caused by:

  • Powering on the chip
  • Pressing the reset button (this brings the /RESET pin low, which resets the chip)
  • Bringing the /RESET pin low by other means (eg. another chip forcing /RESET low)
  • The watchdog timer timing out, if it is configured to do so, and if it is configured to reset the processor when it times out
  • A brown-out (low-voltage) condition being detected, if configured to do so

When does the processor start?

If the reset was caused by the /RESET pin going low, the processor starts a defined time after the /RESET pin goes high again. This time depends on various fuse settings.

In addition, for a power-on reset, the processor is also designed to wait for a certain time (depending on the fuse settings) to allow any external crystal to come up to speed.


Can you make a software reset?

  • Some people claim that jumping to the reset address (address zero) "resets" the processor. This is not true, because the hardware has not been reset. All that does is restart the code running.

  • Another method some authors suggest is using an output pin to bring /RESET low. This is also not recommended, as one of the first things the reset sequence does is make all the pins high-impedance (input) and thus the /RESET pin is not held low long enough.

  • The only reliable way of doing a software-initiated reset, as recommended by Atmel, is to set up the watchdog timer, and then allow it to time-out and invoke a proper hardware reset.

122 questions
23
votes
2 answers

Reset an Arduino Uno in code

Is it possible to reset an Arduino (i.e., to reboot it) from code (i.e from the sketch itself)? I know that is possible with a special circuit but is there a chance to make it just with code? Below is my code and the comment //reset is where I want…
kimliv
  • 561
  • 1
  • 4
  • 17
10
votes
1 answer

How to reset Arduino from software

As you know, the Arduino IDE resets the Arduino when the Serial Monitor is opened. I want also my program to do it. But I don't know how. I examined the source code of the Arduino IDE (Serial.java & SerialMonitor.java), but I can't find where it…
Bhoke
  • 321
  • 3
  • 11
8
votes
1 answer

How does the reset button work on the Arduino?

I'm confused about how and when to use the reset button on the Arduino. Do I simply press the button while it is on? Is it simply restarting the board or clearing the uploaded code as well? Currently when I press the button while my Uno is powered…
Michael Rader
  • 326
  • 2
  • 5
  • 17
7
votes
4 answers

Watchdog timer stuck in restart loop? (green led flashing)

I am trying to set up a way to reboot arduino on command. The code below should do that but it seems like my arduino just get's stuck in some sort of a loop where I cant upload or get any serial output. The green led (pin 13) flashes very fast. The…
DominicM
  • 597
  • 3
  • 7
  • 13
6
votes
1 answer

Why do MEGA2560 digital pins go high on serial disconnect?

I'm trying to set up a system using an that delivers a specific number of digital pulses to a device using one of the digital pins. The number of pulses delivered is specified over a the Mega's USB serial connection using a Python script (or…
c-wilson
  • 163
  • 3
6
votes
3 answers

Two function Reset button - long/short press

I am trying to make a circuit using an ATmega328, that has a reset button that behaves like many consumer devices: A short press just restarts the micro-controller A long press (5 seconds?) causes the settings to be restored to default What is the…
njh
  • 253
  • 3
  • 7
6
votes
5 answers

How do I repurpose Arduino's reset button

Is there a way to repurpose the reset button for the code, like an on-board button? I don't need it to reset, but it would be useful to make it run through a list of RGB LED cycles.
5
votes
2 answers

Jumping to bootloader from application code in atmega328p

I'm trying to program an Arduino Uno (atmega328p) using only the serial Tx/Rx lines (no DTR, so no automatic reset). This is so I can upload code via WiFi/TCP using an ESP-01. To achieve this, I need to Arduino sketch/application to reset itself…
Nuno
  • 63
  • 1
  • 5
5
votes
3 answers

Arduino serial port reset in Serial monitor & Python

So am I using an Arduino with a shield to gain some voltage values for an ECG. I am then plotting that data in Python. However whenever I "observe" the serial port, be that through the Arduino serial monitor or in attempting to plot the values of…
hawkar
  • 553
  • 2
  • 6
  • 12
5
votes
2 answers

Power on reset with arduino uno can never happen. Can this be fixed?

When an Arduino Uno is powered on, the USB chip's DTR output pin may (is, in fact) low for a while. This means that the capacitor C5 is connected from the 328p reset pin to ground. Thus, when power is applied, the reset pin is held low for 10's of…
user69795
  • 206
  • 2
  • 4
5
votes
1 answer

Why Arduino Severino (S3V3) sometimes needs reseting when uploading a sketch?

I have an original Arduino UNO R3 that I bought and an Arduino Severino (S3V3) that I've built. I have no problems uploading sketches to the UNO, but sometimes, when uploading to the Severino board, I have to hard reset it at a specific time during…
Ricardo
  • 3,390
  • 2
  • 26
  • 55
4
votes
2 answers

Arduino resets or stuck during run, only when DC motors are connected

I'm using an arduino connected to 2 DC motors through L298N. the arduino is powered by a 9V battery, and the L298N is powered by 4 AA batteries. there's also a switch that starts the movement. I've added print statements to debug, one in the setup,…
young marx
  • 151
  • 3
4
votes
1 answer

How do I escape a boot loop?

Note: This is a reference question (but feel free to write answers of your own!) I uploaded code that contains a bug that causes my Arduino to immediately reset itself when starting using this code from the AVR libc FAQ. The built-in LED keeps…
glibg10b
  • 317
  • 1
  • 7
4
votes
7 answers

Arduino Pro Micro clone not recognized, flickering RX LED

I have an Arduino Pro Micro clone that seems to be in some sort of reset loop. The RX LED is flickering very fast and very dim. The power LED also seems to flicker at the same frequency but has normal brightness. The Arduino is not recognized by the…
timonsku
  • 141
  • 1
  • 1
  • 4
4
votes
1 answer

Disable Reset when Com Port Connected/Disconnected

I've noticed that when I open and close the com port my Arduino is connected to, the device resets. This makes the program run the setup profile again and it loses the previous variable states. Is there any way to prevent this?
ATE-ENGE
  • 941
  • 3
  • 19
  • 32
1
2 3
8 9