Question: Write an assembly program that meets these requirements: Starts the program code at address 0x0000. Initializes the Stack Pointer to the end of the AVR

 Write an assembly program that meets these requirements: Starts the program

code at address 0x0000. Initializes the Stack Pointer to the end of

Write an assembly program that meets these requirements: Starts the program code at address 0x0000. Initializes the Stack Pointer to the end of the AVR RAM. Defines a main loop called "MAIN" that never exits and calls the following sub routines in the loop body: Calls the subroutine named "LEDS_ON" Calls the subroutine named "DELAY_500MS" Calls the subroutine named "LEDS_OFF" Calls the subroutine named "DELAY_500MS" The code for LEDS_ON and LEDS_OFF is included in this lab. DELAY_500MS should be an instruction based 500ms delay routine for an AVR running at 8 MHz written by you. DO NOT use routine provided for Lab 1 LEDS_ON: SER R16; Set R16 to 0xFF OUT DDRA, R16; Set all PORTA pins to output state OUT PORTA, R16; Set all PORTA pins as logic high RET; Return LEDS_OFF: SER R16; Set R16 to 0xFF OUT DDRA, R16;Set all PORTA pins to output state CLR R16; Set R16 to 0b00000000 OUT PORTA, R16;Set all PORTA pins as logic low RET; Return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!