I'd like keep an ATMEL ATMega328P in reset for about 4 sec while the rest of the board self checks on startup. Is this OK? Are there any issues that would make holding the RESET low for this extended period of time a bad thing to do? I could alternatively turn the power off, but it would be much much easier to just hold reset low, since that can be done with a logic gate.
-
\$\begingroup\$ If there is a signal to go to the logic gate that indicates the end of self check, why not not just route it straight to the micro? While the rest of the board self checks, it can perform it's own initializations, have time to spare, and have one less item on the BOM. \$\endgroup\$– Matt YoungNov 20, 2013 at 3:23
3 Answers
nRESET only has a minimum low width specified; it can be held low for longer than that, and routinely is during ISP. The output ports are tristated, but the pins used for ISP (MOSI, MISO, SCLK, and XTAL1) remain active for the purpose of programming the device and so should be gated separately if the design so requires.
Also note that nRESET may be pulled as high as 12V if parallel programming is allowed or required, and any gating will need to accommodate that as well as the other pins used for parallel programming.
Holding the Reset Pin low puts the ATmega in a low voltage programming mode. Which uses the same pins as the SPI interface, and is basically SPI. So if your board is changing the MOSI or MISO pins, and/or the SCK, there is a slight chance of corruption.
Like most microcontroller datasheets only the minimum reset time (2.5uS for that part) is mentioned and no maximum. The datasheet doesn't explicitly mention long reset times but I can't think of any possible issues. Device programmers often hold the device in reset for an extended time during and after programming.
Having said that normally I'd just use an I/O line to pause the firmware starting up until the rest of the system is ready unless you have other reasons to generate a seperate reset, such as a slowly rising power supply.
-
\$\begingroup\$ The on-board BOD can handle a slow-rising power supply though. \$\endgroup\$ Nov 20, 2013 at 3:37
-
\$\begingroup\$ @IgnacioVazquez-Abrams, true although I've heard a few debates on whether external reset sources are more reliable. Although I've always just used the BOD without problems myself. \$\endgroup\$– PeterJNov 20, 2013 at 3:39