Question: 2. For the ATmega32 program below, answer the following questions. .ORG 0 LOW(RAMEND) LDI R16,HIGH(RAMEND) OUT SPH,R16 LDI R16, OUT SPL,R16 LOOP: CBI PORTB,
2. For the ATmega32 program below, answer the following questions. .ORG 0 LOW(RAMEND) LDI R16,HIGH(RAMEND) OUT SPH,R16 LDI R16, OUT SPL,R16 LOOP: CBI PORTB, 7 CALL DELAY NOP NOP NOP SBI DDRB, 7 SBI PORTB, 7 NOP NOP .ORG 0x50 DELAY: LDI R19, 50 LOOP2: LDI R20, 200 LOOP1: DEC R20 CALL DELAY RJMP LOOP BRNE LOOP1 DEC R19 BRNE LOOP2 RET Number of Machine Cycles for Each Instruction Instruction Instruction Number of Cycles 1 1 1 4 2 2 LDI IN OUT CALL SBI CBI RET NOP DEC BRNE RJMP Number of Cycles 4 1 1 2/1 2 (9 Points) Determine the time delay (in microseconds) for the instructions in the DELAY subroutine (given in gray). Assume that the crystal frequency is 16 MHz.
Step by Step Solution
There are 3 Steps involved in it
To calculate the time delay created by the DELAY subroutine well go through each instruction and cou... View full answer
Get step-by-step solutions from verified subject matter experts
