I am using a custom built arduino UNO for some personal projects. I am using a custom optiboot bootloader given by Nick in this post. This was done to prevent the three LED flashes on digital pin 13.

I have noticed a weird thing with the setup. During normal operation, I am able to reset it by pulling the reset pin low. Sometimes, my microcontroller freezes due to noise and I am unable to reset it by pulling the reset pin low. However powering it off and back on still works.

I am wondering what could be a possible cause for this. Is it the custom bootloader or whether power on reset is different as compared to normal reset? Is there a way to ensure atmega328 always resetting through reset pin? Can noise affect the chip and make it behave in such a way?

After some google searches, I found an issue where people disable the reset pin functionality by setting a fuse but this doesn't seem to be that case because I am able to reset the chip during normal operations.

Updates and edits:

@Nick - Bootloader seems to be working fine. I have ruled out any issues due to the bootloader that you provided because I am having similar issues with original ones as well.

Custom arduino has all the necessary circuit elements - including reset pin pullup 10K resistor and 1N4148 protection diode. I am able to program and run the code without any trouble.

Sometimes, due to electromagnetic noise, the atmega locks up. GPIO doesn't work. Here is a separate question explaining this.

During tests, I leave the board running and wait for that hang-up to occur. During this time period, I deliberately try to induce noise in ac lines (by switching on/off appliances, turning the fan regulator knob etc). When it hangs up, I try to reset it by pulling the reset pin low using a wire. Sometimes it resets and sometimes it doesn't. When it doesn't, the only way out is to power it down and power it up back again.

  • Could you please clarify what you mean by freezing due to noise? Is it possible that this noise upsets more than your code (i.e. causes a brown-out condition that isn't checked for, corrupting the DDRB register or more)?
    – sekdiy
    Commented May 17, 2016 at 6:15
  • @sekdiy Brown-out levels have been raised to 2.7V and mcu is getting brownout reset on separate test and everything starts working as expected. I am not sure about DDRB register corruption. Can that thing disable RESET pin from functioning? And will a power cycle set the things straight? Commented May 17, 2016 at 7:04
  • Can you clarify if the bootloading isn't working, or if this affects the sketch running? That is, after you upload the sketch (say in the morning) and later in the day you have trouble resetting the board?
    – Nick Gammon
    Commented May 17, 2016 at 7:20
  • 1
    @NickGammon - I updated the question to answer your questions. Commented May 17, 2016 at 8:21
  • 1
    @frarugi87 - I tried internal WDT and it failed to reset during those freezes. As a last resort I was using another ESP module present on the same esp to keep checking whether arduino is alive or not and reset it whenever it freezes. In some cases it works but in others it doesn't because grounding the reset pin isn't helping anymore. I thought nothing will be as robust as resetting it externally using reset pin but now, only power cycle seems to be 100% reliable. Implementing power cycle is a difficult option. Commented May 17, 2016 at 10:33


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.