Really Screwed Up

I wanted to create a reset in my code after a certain event occurs, because for some untraceable reason, when this event occurs (radio transmission) the system hangs up. I have two SPI gadgets on the board, and although they both work, sometimes the radio hangs up. Likely a timing or interrupt problem.

So I decided to apply a watchdog timer to trigger after a radio tx, allowing 15 ms. before resetting. I activated it after the point in the code where a tx is called. That is not in the main loop, so I assumed it would only trigger once, each time I called for transmission. Boy was I wrong!

So now I have the timer resetting the Nano every 15 ms., and program upload is kaput. So have I bricked this Nano, or is there a way to foil the wdt and get new code into the chip?

Thanks in advance for any assistance.

Press & Hold Reset during a download, when the IDE shows "compiled xxx of 32xxx bytes" release it.
File:Preferences, enable verbose outputs, can make the timing easier to see when to release the button.

If you can't make that work, then re-bootload the Uno.

Re-bootload it.

If you rebootload it as an Uno (and select Uno when you upload to it afterwards) you can use the WDT without this problem (it's a oversight in the Nano bootloader - The uno bootloader is smart enough to turn off the WDT if needed) - the Uno bootloader takes up less flash than the Nano one too.

But you will lose A6 and A7.
The Uno bootloader is 2X as fast.

Isaac96:
But you will lose A6 and A7.

No, you can still use them after burning the Uno bootloader. The only difference is that the NUM_ANALOG_INPUTS macro is set to 6 instead of 8. That macro isn't used anywhere in the Arduino core. The only built-in library that uses it is Firmata. Some sketches and 3rd party libraries may use that macro but I haven't encountered it anywhere.

I could not get the press and hold to work. I soldered an ISP header to the nano, made a cable to hook it to an Uno, and loaded the Arduino as ISP to the Uno. I tested the setup by downloading the Blink program. Now I am trying the burn bootloader option, but it has been doing nothing at all for about 15 minutes. Of course the Nano still has the WDT enabled at 15 ms., and that aooears to still be running.

Thanks for the help so far. Any further suggestions would be appreciated.

  • Unplug the Uno
  • File > Preferences > Show verbose output during > Upload(check)
  • Plug the Uno back in
  • Tools > Burn Bootloader
  • Once the process hangs up or fails copy ALL the text from the black console window at the bottom of the IDE window and paste it here using code tags(</> button on the toolbar).

I wanted to create a reset in my code after a certain event occurs, because for some untraceable reason, when this event occurs (radio transmission) the system hangs up.

This almost always caused by a voltage drop to the microcontroller when the higher current for the RF section comes on... in some systems such as the ESP8266, the current spike can exceed 500mA... so, poor wiring or copper conductors that are too small gauge, or a weak power supply / batteries, can really play havoc with these circuits.

Ray