What does constantly pulling the RESET pin low do?

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have read the following statement:

AVR microcontrollers support in-system programming (ISP): you can reset them by pulling the !RESET pin low and then releasing it, and while the !RESET pin is low you can talk to them over their Serial Peripheral Interface (SPI) and give them instructions to overwrite the program stored in their Flash memory.

I thought pulling the Reset pin on an "Arduino Uno" basically disables the AVR microcontroller, as if it was removed? so that is not the case then?

 

What does the reset do exactly? 

 

When reset is NOT pulled low, what happens to the same set of instructions sent to the MCU? does it not interpret them as commands anymore? what will they be interpreted as?

 

Last Edited: Mon. Jun 29, 2020 - 07:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If reset is not pulled low then you cannot send instructions to the chip. Programming normally uses the same pins as the SPI peripheral and when reset is not pulled low those pins are normal IO pins which can be assigned to that peripheral.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When reset is NOT pulled low, what happens to the same set of instructions sent to the MCU?

As Brian said, pulling the Reset\ pin low can initiate an ISP programming process, where the micro then reads the SPI (or sometimes other) interface and uses it to (re)program the chip.

Pulsing the Reset\ pin low also resets the micro, all I/O pins go to their input mode, and the micro begins executing the program it already has programmed into it.

 

If you were to send a bunch of programming commands to the micro without first initiating the programming mode by pulling the Reset\ pin low, the micro wouldn't be in programming mode, and it wouldn't load the new program into the chip.  If you had any other devices, perhaps an SD card, also attached to the SPI interface, randomly sending data out over those pins might well wreck havoc on the system.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

When reset is NOT pulled low, what happens to the same set of instructions sent to the MCU?

As Brian said, pulling the Reset\ pin low can initiate an ISP programming process, where the micro then reads the SPI (or sometimes other) interface and uses it to (re)program the chip.

Pulsing the Reset\ pin low also resets the micro, all I/O pins go to their input mode, and the micro begins executing the program it already has programmed into it.

 

If you were to send a bunch of programming commands to the micro without first initiating the programming mode by pulling the Reset\ pin low, the micro wouldn't be in programming mode, and it wouldn't load the new program into the chip.  If you had any other devices, perhaps an SD card, also attached to the SPI interface, randomly sending data out over those pins might well wreck havoc on the system.

 

JC 

 

Does pulling the RESET low have any other usages beside putting MCU into programming mode (and of course resetting the pins)? is it a builtin feature of most/all MCUs or just AVR?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avruser1523 wrote:

Does pulling the RESET low have any other usages beside putting MCU into programming mode (and of course resetting the pins)? is it a builtin feature of most/all MCUs or just AVR?

All MCUs need a RESET signal (on some MCUs that can be internally derived from a voltage detector, freeing up a pin), and the other important thing RESET does besides define the pins & SFRs, is to reset the Program Counter, which points to the next byte to execute. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In an AVR, activating a reset also resets many registers beyond the Program Counter. For example, All Port Direction and Port value registers are cleared, which makes all of the port pins (the ones related to PORTs anyway) to be inputs with no pull-up. This effects virtually every peripheral, including counters, TWI, SPI, and UART. Other micros may handle this differently; there is no "standard".

 

Jim

 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Who-me wrote:
reset the Program Counter, which points to the next byte to execute. 

Resets it to a predefined memory address? or to 0?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

to 0, like almost all registers will become 0 when you make the reset line low.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avruser1523 wrote:
Resets it to a predefined memory address? or to 0?
It resets all the registers to the default values given in the datasheet.

 

For PC the datasheet will tell you that it is either reset to 0 or to (usually) one of 4 addresses given by the BOOTSZ fuses if BOOTRST is set. But on the whole you can probably assume 0x0000 in "normal" operation.