- physically press the restart button
- upload a new program
- send the RESET pin to LOW
Assuming an Uno-like board, with the optiboot bootloader, these three are exactly equivalent; they all "set the reset pin low" (via the auto-reset circuitry for (3)), and then the reset proceeds "as per the datasheet", with the 'reset cause" set to "external reset."
"As per the datasheet" means that a bunch of the internal IO registers get set to their default state (listed in the datasheet), and execution is started at the bootloader start address. The bootloader runs and looks for new upload attempts. If it doesn't see one, it causes a "watchdog reset" (one of the software-based methods.)
- cycle power
A power cycle is slightly different. It causes the same internal register defaults, except that the cause will be set to "power up."
Also, a power-cycle will reset the "watchdog running" bit, which is NOT reset by other forms of reset. (This is why you occasionally see instructions for getting an Arduino out of some "bricked" state that involve holding down the reset button while turning on the power; when you finally release the button, the power-on reset will proceed.)
Execution begins at the bootloader again, but the bootloader starts the user sketch immediately instead of looking for new data. (the so-called "Adafruit Fast Start Mod") Also, power-up reset seems to leave most of the CPU registers at 0, whereas external reset leaves them as-was (except for the ones modified by the bootloader.) (This has caused at least one "interesting" bug.)
- invoke one of the several software-based restart methods I've read about?
Other than the method that involves causing a watchdog reset, software-reset methods DO NOT set the internal registers to their defaults, so they can be very prone to not working right. Peripherals left running in unexpected modes, interrupts left enabled even though the data necessary for them to work hasn't been initialized, etc. Bad news!
The "turn on the watchdog and wait for it to reset the CPU" ends up causing a real RESET (as per datasheet), with the reason set to "watchdog reset." The bootloader starts, notices the cause, and starts the sketch immediately.
Does it simply restart the current program (i.e. run start() and then loop() repeatedly), or does it also set I/O pins and other hardware settings (such as analogReference, pullup resistors) to their "default" states?
In addition to the reset functions mentioned in the datasheet, the "user sketch" will be started AT THE VERY BEGINNING; well before loop(). First, some standard C/C++ initialization code runs, clearing some memory, initializing the initialized variables (remember that your variables are in RAM, and their initial values have to be in flash somewhere. Code has to exist to move the flash values into ram.) Static C++ objects are constructed by calling their constructor routines.
THEN the C++ program begins a main(), which sets up the chip IO registers and hardware settings as appropriate for the Arduino libraries and environment (for example, it sets up timer0 to cause the periodic interrupt that drives the millis() clock.)
and THEN the code calls setup() where the user code gets to initialize things.
and THEN loop() gets run, over and over again.