Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Additional problems assigned: 1) For the program below, answer the following questions. a) Determine the time delay in ms in the DELAY subroutine. b) What

image text in transcribed

Additional problems assigned: 1) For the program below, answer the following questions. a) Determine the time delay in ms in the DELAY subroutine. b) What action operation is performed in the loop AGAIN? Assume that the crystal frequency is 8 MHz and the system is using an ATmega32. .ORG 0 LDI R16,HIGH(RAMEND) OUT SPH.R16 LDI R16, LOWRAMEND) OUT SPL,R16 LDI R16,0x40 AGAIN: COM R16 OUT PORTD R16 CALL DELAY RUMP AGAIN DELAY: LDI R19,50 LOOP1: LDI R20,100 LOOP2: LDI R21,200 LOOP3: NOP DEC R21 BRNE LOOP3 DEC R20 BRNE LOOP2 DEC R19 BRNE LOOP1 RET 2) Find the time delay of the following program assuming an oscillator frequency of 4 MHz. Modify the program to achieve the same delay using a nested loop. DELAY: LDI R17, 100 LOOP1: NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP DEC R17 BRNE LOOP1 RET Additional problems assigned: 1) For the program below, answer the following questions. a) Determine the time delay in ms in the DELAY subroutine. b) What action operation is performed in the loop AGAIN? Assume that the crystal frequency is 8 MHz and the system is using an ATmega32. .ORG 0 LDI R16,HIGH(RAMEND) OUT SPH.R16 LDI R16, LOWRAMEND) OUT SPL,R16 LDI R16,0x40 AGAIN: COM R16 OUT PORTD R16 CALL DELAY RUMP AGAIN DELAY: LDI R19,50 LOOP1: LDI R20,100 LOOP2: LDI R21,200 LOOP3: NOP DEC R21 BRNE LOOP3 DEC R20 BRNE LOOP2 DEC R19 BRNE LOOP1 RET 2) Find the time delay of the following program assuming an oscillator frequency of 4 MHz. Modify the program to achieve the same delay using a nested loop. DELAY: LDI R17, 100 LOOP1: NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP DEC R17 BRNE LOOP1 RET

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899