Question: 4. For the ATmega32 program below, answer the following questions. Number of Machine Cycles for Each Instruction Instruction Number Instruction Number of of Cycles Cycles

 4. For the ATmega32 program below, answer the following questions. Numberof Machine Cycles for Each Instruction Instruction Number Instruction Number of ofCycles Cycles LDI 1 RET 4 IN 1 NOP 1 OUT DEC

4. For the ATmega32 program below, answer the following questions. Number of Machine Cycles for Each Instruction Instruction Number Instruction Number of of Cycles Cycles LDI 1 RET 4 IN 1 NOP 1 OUT DEC 1 1 CALL SBI CBI 2 2 BRNE RUMP 2/1 2 ORGO LDI R16.HIGH(RAMEND) OUT SPHR16 LDIRI6, LOW RAMEND) OUT SPLR16 SBI DDRB 4 LOOPSBI PORTB, 4 CALL DELAY NOP NOP CBI PORTC, 2 CALL DELAY CBI PORTC, 2 CALL DELAY RIMP LOOP ORG OX 150 DELAY: LDI R27, 30 LOOP2: LDI R28, 60 NOP NOP NOP LOOPI: DEC R28 BRNE LOOPT DEC R27 BRNE LOOP2 RET a. (9 Points) Determine the time delay in microseconds) for the instructions in the DELAY subroutine (given in gray). Assume that the crystal frequency is 8 MHz. b. (4 Points) Determine the time required (in microseconds) to execute one iteration through the loop LOOP. 4. For the ATmega32 program below, answer the following questions. Number of Machine Cycles for Each Instruction Instruction Number Instruction Number of of Cycles Cycles LDI 1 RET 4 IN 1 NOP 1 OUT DEC 1 1 CALL SBI CBI 2 2 BRNE RUMP 2/1 2 ORGO LDI R16.HIGH(RAMEND) OUT SPHR16 LDIRI6, LOW RAMEND) OUT SPLR16 SBI DDRB 4 LOOPSBI PORTB, 4 CALL DELAY NOP NOP CBI PORTC, 2 CALL DELAY CBI PORTC, 2 CALL DELAY RIMP LOOP ORG OX 150 DELAY: LDI R27, 30 LOOP2: LDI R28, 60 NOP NOP NOP LOOPI: DEC R28 BRNE LOOPT DEC R27 BRNE LOOP2 RET a. (9 Points) Determine the time delay in microseconds) for the instructions in the DELAY subroutine (given in gray). Assume that the crystal frequency is 8 MHz. b. (4 Points) Determine the time required (in microseconds) to execute one iteration through the loop LOOP

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!