Question: Problem 2: (50%) (CLO2] a) For the schematic diagram shown in Figure 1, what binary pattern will be displayed on the LEDs (connected to pins

 Problem 2: (50%) (CLO2] a) For the schematic diagram shown in

Problem 2: (50%) (CLO2] a) For the schematic diagram shown in Figure 1, what binary pattern will be displayed on the LEDs (connected to pins 100-107) if the given Assembly language code is executed by the microcontroller? b) What will be the content of registers R20, R21, R24, and R25 at the end of program execution? c) For a 10MHz clock generator (crystal oscillator), find the amount of time in seconds taken by the microcontroller to execute the given assembly code. Number of machine cycles (MC) for each instruction is given in comments in the program. OPORTE PUXORONTO POUTDONTIT TOCANTE O PONTS CONTE Ho FONTUOCERONT FESMOLOCARONTO 10 4102COOH - X2 EX POATION FORTI CTS O PORANDOBAPONY TOSCATALO er PIANI POINTS TOSCOXTALI ON PODADOWONACO ec PORADCU PORTE ADE POSIADCAPONTI OACA POSADOS CINTU OAB POMIDORONRON 808 CERCA ECLECTICA POSTEN REGET CUOLE 10 HD MOS ot OM 013 SCH 1 OS ADI ote OD ORT OTT ADD CU AD 003 CB AD L. 010 O ge Figure 1: Circuit diagram for Problem 2 Page 1 of 3 Assembly code for problem 2(a,b,c): .def DDRD = 0x2A .def PORTD + 0x2B Start: MC ; 2 11 11 11 OUTER: INNER: LDI R24, 0xFF STS DDRD, R24 LDI R24, 5 LDI R25, 0 LDI R20, 4 LDI R21, 3 DEC R20 DEC R21 BRNE INNER ADD R25, R24 STS PORTD, R25 DEC R20 BRNE OUTER 1 , 2/1 2 1 7 2/1 HERE: ... rest of the code d) Comment each line of the C code given below explaining the purpose of each command. What will be the behavior of the circuit in Figure 1 if the microcontroller executes the given Ccode. C code for problem 2(d): #include int main(void) DDRB &=1

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!