V
V
Vadimm10012018-04-30 17:33:07
Microcontrollers
Vadimm1001, 2018-04-30 17:33:07

What is the RESET AVR procedure?

Everything that is described below is tested in the Proteus program.
Let's say code has only two interrupts defined in the vector table, RESET and an ADC conversion interrupt. After the vector comes the RESET handler, then an empty infinite loop and then the interrupt handler from the ADC. If the RESET: label itself is removed in this code, that is, only the label, but not the RESET interrupt handler, the code does not work (the PC ends up in empty memory), although the code that was in the RESET handler is actually executed (probably).
And again, if this interrupt is executed when the MK starts, then why if I place the RESET interrupt handler last - it also does not work (the PC gets into empty memory).
Essence of the question:
- Why does this happen if you make the changes in the code that I described above?
-What is the RESET procedure for?
-How is it called?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-04-30
@Vadimm1001

Why does this happen if you make the changes in the code that I described above?

Give the code itself in the question, without it we can only guess what is happening.
But if you guess, then:
and shouldn't even compile. Because in the reset vector there should be a jump command to the RESET: label.
maybe there is not enough range of the rjmp command (4 kilobytes) to go from the vector to the handler?
to initialize the controller
transition from reset vector

V
vanyamba-electronics, 2018-05-02
@vanyamba-electronics

I recommend reading the datasheet for the microcontroller, section Interrupt Vector Table.
Interrupt #0 RESET_vect is called when the microcontroller is reset (rising edge at the nRESET input).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question