Reset button not working repeatedly

Is there some minimum time you must allow before pressing the UNO reset button will work?

With this minimal test program, if I used reset within less than about 10 s (10 repeats of my print line), nothing happened. No print.

Worse: no matter how long I then waited before using reset, the sketch would never restart.


void setup()
{
  Serial.begin(115200);
  delay(200);
  Serial.println("Test_NoRestartUSB");
  delay(1000);
}

void loop()
{
  Serial.println("Test reset");
  delay(1000);
}

Tried several different USB sockets (and two cables) , all displaying COM4, but no change.

I suspect the serial communication to your com4 port does not initialize properly. When you would test by having the led on for 1 second during setup and then repeat short flashes in the loop, you can test if when you press reset you see the led on for 1 second.

No, the hardware guarantees that there isn't any. The CPU is completely reset within a few microseconds of the RESET line going LOW.

However, the RESET state won't affect external events and devices unless they are connected to it.

Thanks both.

Meanwhile I ran the Blink sketch, and that allowed me to reset or power on/off with no time constraint.

Then I added Serial print. After uploading it (see code below) it ran, but as before it would not reset after a few seconds. Then not at all.

EDIT: I've just re-run the plain Blink sketch, reset it a few timee, then used Ctrl+U. That did not report an error.

I have been doing some reorganising of \libraries. Wondering if that's a clue?

// Blink, with Serial added.
void setup()
{
  Serial.begin(115200);
  Serial.println("Sketch is running in setup");


  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop()
{
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);
  
  Serial.println("Sketch is running in loop");
}

Also, a symptom I didn't mention before, when I then uploaded again (Ctrl+U) it gave an error about the port, COM4. I was getting these frequently with my previous sketch too.

Full error report:

Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\terry\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\terry\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\libraries -fqbn=arduino:avr:uno -vid-pid=2341_0043 -ide-version=10819 -build-path C:\Users\terry\AppData\Local\Temp\arduino_build_694042 -warnings=none -build-cache C:\Users\terry\AppData\Local\Temp\arduino_cache_295314 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\My Sketches\MY SKETCHES 2021-2022\TestSerial\TestSerial.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\terry\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\terry\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\libraries -fqbn=arduino:avr:uno -vid-pid=2341_0043 -ide-version=10819 -build-path C:\Users\terry\AppData\Local\Temp\arduino_build_694042 -warnings=none -build-cache C:\Users\terry\AppData\Local\Temp\arduino_cache_295314 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\My Sketches\MY SKETCHES 2021-2022\TestSerial\TestSerial.ino

Using board 'uno' from platform in folder: C:\Users\terry\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Using core 'arduino' from platform in folder: C:\Users\terry\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5

Detecting libraries used...

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\sketch\\TestSerial.ino.cpp" -o nul

Generating function prototypes...

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\sketch\\TestSerial.ino.cpp" -o "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\preproc\\ctags_target_for_gcc_minus_e.cpp"

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\cores\\arduino" "-IC:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.5\\variants\\standard" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\sketch\\TestSerial.ino.cpp" -o "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\sketch\\TestSerial.ino.cpp.o"

Compiling libraries...

Compiling core...

Using precompiled core: C:\Users\terry\AppData\Local\Temp\arduino_cache_295314\core\core_arduino_avr_uno_04e3c16ce2b5ca51807397f8e3924bad.a

Linking everything together...

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.elf" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042\\sketch\\TestSerial.ino.cpp.o" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/..\\arduino_cache_295314\\core\\core_arduino_avr_uno_04e3c16ce2b5ca51807397f8e3924bad.a" "-LC:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042" -lm

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.elf" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.eep"

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.elf" "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.hex"

"C:\\Users\\terry\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\terry\\AppData\\Local\\Temp\\arduino_build_694042/TestSerial.ino.elf"

Sketch uses 2032 bytes (6%) of program storage space. Maximum is 32256 bytes.

Global variables use 240 bytes (11%) of dynamic memory, leaving 1808 bytes for local variables. Maximum is 2048 bytes.

C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:C:\Users\terry\AppData\Local\Temp\arduino_build_694042/TestSerial.ino.hex:i 



avrdude: Version 6.3-20190619

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2014 Joerg Wunsch



         System wide configuration file is "C:\Users\terry\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : COM4

         Using Programmer              : arduino

         Overriding Baud Rate          : 115200

         AVR Part                      : ATmega328P

         Chip Erase delay              : 9000 us

         PAGEL                         : PD7

         BS2                           : PC2

         RESET disposition             : dedicated

         RETRY pulse                   : SCK

         serial program mode           : yes

         parallel program mode         : yes

         Timeout                       : 200

         StabDelay                     : 100

         CmdexeDelay                   : 25

         SyncLoops                     : 32

         ByteDelay                     : 0

         PollIndex                     : 3

         PollValue                     : 0x53

         Memory Detail                 :



                                  Block Poll               Page                       Polled

           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff

           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff

           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00



         Programmer Type : Arduino

         Description     : Arduino

         Hardware Version: 3

         Firmware Version: 4.4

         Vtarget         : 0.3 V

         Varef           : 0.3 V

         Oscillator      : 28.800 kHz

         SCK period      : 3.3 us



avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x53

avrdude: initialization failed, rc=-1

         Double check connections and try again, or use -F to override

         this check.



avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x6b



avrdude done.  Thank you.

I reinstalled the IDE (1.8.19) and so far things look OK.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.