Hot answers tagged

24

There three ways to accomplish this. (last is my favorite) 1) Jumper an unused IO to the RESET pin. Leave it as INPUT for normal run, As it is externally pulled high. And when desired to reset set it as LOW and Output. (bang its rebooting). setup() { ... pinMode(PINtoRESET, INPUT); // Just to be clear, as default is INPUT. Not really needed. ...


10

OK, I have solved this by sending DSR pulse as seen on code below: mySerial.DtrEnable = true; mySerial.Open(); Thread.Sleep(1000); mySerial.DtrEnable = false;


9

If you just want the reset button to change the program mode, the simplest thing would be to let the button reset the Arduino and switch modes each time your program restarts. Then you do not need to change the fuses or get a high voltage programmer. The code would look like this: void setup() { // At startup, switch to the next mode. if (++mode >...


8

The reset button does pretty much the same as unplugging the board and plugging it back in. It restarts your program from the beginning. The same thing happens when you program the board - the USB interface presses the reset button for you. That then enters the bootloader for a second or two so it can try and program it. When you reset the board the ...


7

Atmel specifically recommend against driving /RESET low from an output pin, because the first thing that the reset process does is set all pins to high impedance, thus cancelling the reset pulse before the recommended reset pulse length has elapsed. The recommended use of the watchdog timer does not suffer from these limitations. It is designed to reset the ...


7

It can be done with one button, one resistor, one capacitor and one GPIO pin (in addition to the RESET pin): simulate this circuit – Schematic created using CircuitLab Pressing the button causes a LOW pulse on the RESET pin (in the exact same way as the USB interface does). During your startup procedure you read the GPIO pin you have chosen. If it's ...


6

If you review the Uno schematic, you can see the circuitry that enables an automatic reset when serial communication starts. The circuitry is intended to allow easy program downloading. There are two or three ways to prevent that reset: add a 10 μF capacitor from ground to reset; use a much-lower resistance for the pullup on reset; cut a trace from the ...


5

Save the variables you need to EEPROM.


5

It's happening because you're not giving the ESP8266 a chance to do its housekeeping activities and the watchdog (which is enabled by default) is timing out - as evidenced by the very first line of your output: Soft WDT reset You need to allow the MCU to do other things at the same time as you are printing to serial: void foo(){ for(unsigned int i =...


4

One of the most obvious issues here is that you are enabling the watchdog timer with a delay of 1S and then you are asking the micro controller to sleep for 2S, printing something and then going back into the loop. This, in theory, should be fine(your wdt should trigger a reboot during the 2 second wait) but I've seen it cause issues. Additionally some ...


4

Here is the circuit I use which depends on a heartbeat from the arduino and resets the arduino if 8 pulses are missed and also enables the arduino code to know that an external watchdog reset occured and the Arduino code which can be incorporated into your sketch //Watchdog #define ResetDetect 8 // watchdog detect pin, HIGH if a watchdog reset has ...


4

The following 555 circuit will produce a 170 ms low-going pulse every 24.2 hours. You can adjust the values of the components using this calculator if you want different timing parameters. Since the reset line of a microcontroller is configured for open-drain (meaning you can connect several inputs to it, which is a good thing since we are taking advantage ...


4

If your pro micro does not have a reset button, wire one between reset and ground. Press reset twice, quickly, and immediately hit upload on the IDE. Secondly, make sure you've downloaded and installed the Sparkfun board files for the pro micro.


4

A Reset is necessary to activate the Bootloader and allow programming. Without the DTR signal the Reset button has to be pressed just before starting the upload from the Arduino IDE.


4

That's the firmware waiting for a programming connection. If you want alternate behavior them burn SparkFun's ATmega32U4 firmware to it. One press of Reset will reset the device, and two presses will put it into programming mode.


4

Every time you rewrite an Arduino, the previous code is completely wiped out (except for the bootloader, which doesn't change). You will not fill up your arduino -- it is not like a filesystem where you are continually adding new files. Each new programming/upload overwrites all the existing code. Uploading a blank sketch is the genuine way to "erase" an ...


4

1/0 is an exception (divide by zero). esp8266 arduino core has soft reset: ESP.reset(). Calling this function you get a valid reset. Note to software reset. esp8266 has a bug. If software reset (or exception) is executed in program started right after the flashing, the board goes back to flashing mode because the flashing flag is still active. Perhaps you ...


4

There is no power spike or loss to the PCB. The car is not actually running, I am just turning the key on and off. And did you verify that with a digital scope? I doubt it. I don't think you understand how ugly the electrical system in a car really is. If there is a coil or relay switched then there will be spikes. Do some research on electronics for ...


4

While it looks interesting as idea, IHMO you have keep in mind: Include some code for button denouncing logic. Actually you will receive couple of “resets” during ~20ms during button press. Without denouncing you may end up with reset signal right at the moment you write to the EPROM. While EPROMs are pretty “solid” nowadays, it many not be good practice. ...


4

There are two things wrong with the circuit in that demo. There is no decoupling capacitor on the power pins. This is required to keep the power stable during opertaion. More critically: this is being powered from 3.3V, but is being run at 16MHz. That is outside specifications. You should use an 8MHz crystal to operate at 3.3V.


4

Derived derivedObj; is a local variable. It's deleted when the function exits. You have saved a pointer to it, but with that object now gone your pointer points to nothing of any interest - so doing anything with it is doomed to failure. Instead you need to create a new object on the heap, which will already be a pointer: Derived *derivedObj = new Derived(); ...


4

My personal preference would be to attach a NOT gate to the RESET pin. This can be constructed very simply from a single NPN transistor (or N-channel MOSFET) and a resistor. simulate this circuit – Schematic created using CircuitLab With the wire disconnected R1 turns on Q1 which pulls the RESET pin LOW. With the wire connected Q1 is turned off, ...


3

You can reset the Uno over the serial link by toggling the DTR line. How you do that depends on what platform and language you are using. There is a capacitor between the line and the reset pin, so the toggle must last a minimum ammount of time. 0.5 seconds works. This is ok for just a quick fix hack, but probably better in the long run to (1) figure out ...


3

ok guys - found the answer: this post here at electronics-stackexchange gave the right hint: Watch-Dog Timer. And my gut feeling was right as well - i simply use a NPN-Mosfet that is being triggered by an Arduino-PIN (which easily can be done while sleeping as well as sleeping means waking up every 8seconds anyway) that connects the capacitor to ground and ...


3

Why does that happen? When the serial port is opened by either monitor, avrdude or other it toggles the DTR pin of the serial port. Which in turn is AC coupled through C4 100nF. This toggling is converted to a up and down pulse on the ATmega(CPU)'s RESET pin. The subsequent reset starts initially with the boot loader, which typically in turn waits for a ...


3

In case you have the original Arduino bootloader which you want to execute as a part of the reset, you can do a SW reset by jumping to the bootloader reset address (0x7800 on ATmega328p boards) void reset() { asm volatile ("jmp 0x7800"); } The watchdog reset approach will not work because of a bug in the bootloader. Here's a note from ATmega328P ...


3

You can't. There is no way of detecting if the serial monitor is open or not. However, you can disable the automatic reset and provide some functionality in your code for saving data to EEPROM when prompted through a command entered on the serial monitor (if you now need to even save the data).


3

The first thing that happens when you apply power to a board or press reset, is the bootloader executes. That waits for a short time to accept a new sketch over the serial port. If nothing arrives it terminates and executes the existing sketch. On the Uno that delay is only 2 seconds. However on the Leonardo the delay is much longer (around 5-8 seconds) ...


3

What you have done is to disable the "HUPCL" signal that is sent when the port is opened/closed. You can turn the signal back on with: $ stty -F /dev/ttyACM3 hupcl And you can turn it off again with: $ stty -F /dev/ttyACM3 -hupcl HUPCL means "HangUP on CLose".


3

Yes, it is possible. See the documentation on memory sections, from the avr-libc manual. For example: // Run this after initializing the stack pointer and zero_reg, but // before initializing the RAM. void __attribute__((naked, used, section(".init3"))) magic(void) { // Whatever... } Note that this runs after both a warm reset and a cold boot. See ...


Only top voted, non community-wiki answers of a minimum length are eligible