Question: Using an ATMEGA32PM AVR microcontroller. 1. Write a program to initialize the stack pointer using R16 and the end of the RAM data. 2. Write
Using an ATMEGA32PM AVR microcontroller.
1. Write a program to initialize the stack pointer using R16 and the end of the RAM data.
2. Write a program to loop 10 times. Initialize R20 for the loop. Set the label LOOP: as the start of the loop. Do nothing in the loop (NOP) and the decrement R20. Check the condition of R20 to see if it is zero. Keep jumping back to LOOP: until R20 is 0. When is done branching and R20 is 0, then go to an unconditional loop with the statement HERE: RJMP HERE.
3. Write a program to CALL a subroutine that does nothing. Initialize the stack pointer using the program from the question above. Set the label START: as the start of the program. Do nothing after the START: (NOP). CALL the SUBROUTINE: program. Do nothing in the SUBROUTINE program and then RET to the main program. End the program with the unconditional loop with the statement HERE: RJMP HERE.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
