re-set pin 1 what does it do?

hi,
just wondering what actually happens within the ic when, a low is applied to pin 1, im thinking the software is re-loaded somehow and starts again?
thank you

jonisonvespa:
hi,
just wondering what actually happens within the ic when, a low is applied to pin 1, im thinking the software is re-loaded somehow and starts again?
thank you

Not exactly. First chip does hardware reset functions to put all known built in hardware into a know start-up condition. After that is completed (on an arduino) then program execution starts with the bootloader program located in high flash memory location. The bootloader waits a small amount of time to see if there is a new uploading request pending from the IDE software on the PC, if not and if there is a prior sketch already existing in flash memory then the bootloader jumps to that user program. If there is no prior sketch loaded then the bootloader will just wait forever for a upload request from the IDE.

There is no need to 'reload' a program on a reset (if it has already been uploaded), as Flash memory is non-volatile and will survive a reset or power down/up cycle.

Lefty

Unlike a lot of computer systems arduino code runs straight out of flash, there is no RAM to download it into.

just wondering what actually happens within the ic when, a low is applied to pin 1, im thinking the software is re-loaded somehow and starts again?

When a low is applied to the reset pin of an ATmega the processor essentially stops running it's program code.

When the low is removed (when the pin goes high again) the processor starts running its program code from the beginning, which in the case of the Arduino is with the bootloader as mentioned in reply #1. The code itself is non-volatile, it remains in memory and therefore does not have to be loaded as mentioned in reply #1 and #2.

Don

thanks

More basically - it causes an interrupt - interrupt 0 - which, in the case of the Arduino, executes the bootloader code and then any loaded sketch.