Question: Question 2 : [ 1 0 points ] a ) The program given below has several errors and it consumes extra memory due to some

Question 2: [10 points]
a) The program given below has several errors and it consumes extra memory due to some instructions in the program. Rewrite the program to remove the errors and make it efficient so that it consumes less memory.
[5 points]
\table[[LDI R15,10 ; initialize loop counter,],[LDI 0,R17 ; clear R17,],[BACK: LDS R18, $100,],[ADD R17,R18,],[LDS R19, $30,],[SUB R19,R17,],[STS $32,R19,],[LDI R20,1,],[SUB R15,R20,],[BREQ DONE,],[JMP BACK,],[DONE: JMP DONE,]]
Hint: To reduce memory consumption, recall the memory map of the data address space
b) Write an assembly program to generate two square waves simultaneously - one on each pin PB3 and PB7, respectively, as indicated below. Subroutine called DELAY is available for use. Don't use timers here. [5 points]
\table[[Square wave of 20% duty cycle on PB3,
 Question 2: [10 points] a) The program given below has several

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!