(a) Construct a program code using AVR assembly language to read the value available on PortB...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(a) Construct a program code using AVR assembly language to read the value available on PortB pins and PortC pins. Then multiply the two values and store the result (which is 2 bytes) in the memory location: 0x50 for LSB byte and Ox51 for MSB byte. Then show the result from LSB byte on PortA pins. (c) (b) Calculate the total period (T), cycles loop in LOOP1 and LOOP2, the overall loop (total cycles) and the size of delay of the program code below if the crystal frequency is 1 MHz. DELAY: LDI R21, 100 LOOP2: LDI R20, 200 LOOP1: NOP NOP DEC R20 BRNE LOOPI DEC R21 BRNE LOOP2 RET AGAIN: LDI R17, 0xFF OUT DDRB, R17 LDI R17, 0xFF OUT DEC R17 CALL DELAY RJMP AGAIN Instruction Cycles PORTB, R17 ; 2/1 [CO2, P01, C3] ; 1 ; 2/1 ;4 The following code below is written in AVR assembly language. Explain the following program line by line. Determine the value to be read from PortB to stop the loop. (Example: Line 1: //Load Ob11111111 in R17). [CO2, PO1, C3] (a) Construct a program code using AVR assembly language to read the value available on PortB pins and PortC pins. Then multiply the two values and store the result (which is 2 bytes) in the memory location: 0x50 for LSB byte and Ox51 for MSB byte. Then show the result from LSB byte on PortA pins. (c) (b) Calculate the total period (T), cycles loop in LOOP1 and LOOP2, the overall loop (total cycles) and the size of delay of the program code below if the crystal frequency is 1 MHz. DELAY: LDI R21, 100 LOOP2: LDI R20, 200 LOOP1: NOP NOP DEC R20 BRNE LOOPI DEC R21 BRNE LOOP2 RET AGAIN: LDI R17, 0xFF OUT DDRB, R17 LDI R17, 0xFF OUT DEC R17 CALL DELAY RJMP AGAIN Instruction Cycles PORTB, R17 ; 2/1 [CO2, P01, C3] ; 1 ; 2/1 ;4 The following code below is written in AVR assembly language. Explain the following program line by line. Determine the value to be read from PortB to stop the loop. (Example: Line 1: //Load Ob11111111 in R17). [CO2, PO1, C3]
Expert Answer:
Answer rating: 100% (QA)
I can help you with the explanation of the AVR assembly language code provided Heres a breakdown of ... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these accounting questions
-
On Test B, multiply each score by 3 and then subtract 5 points from every score. a. What effect did these changes have on the mean? Does this fit with your understanding about the effect of score...
-
Using a present value table, your calculator, or a computer program present value function, verify that the present value of $100,000 to be received in five years at an interest rate of 16%,...
-
Using the following assembly line information, construct a flow diagram using arrows to indicate sequence and precedence, calculate the takt time, calculate the minimum number of workcenters ,...
-
your client believes the share price of IBM Ltd., currently selling at $45 a share, could move substantially in either direction due to an on-going acquisition negotiation on price, which is expected...
-
Forced expiratory volume (FEV) is a measure of the rate of airflow (L/min) during one deep exhalation. For each of 75 students, FEV was measured three times, and those results were averaged to give a...
-
The circuit here is made of two batteries (6 volt and 9 volt) and three resistors (47 ohms, 470 ohms, and 280 ohms). The batteries create an electric current in the circuit. Let x, y, and z represent...
-
Describe various forms of child abuse, how to recognize it, and reporting requirements.
-
Total marketing effort is a term used to describe the critical decision factors that affect demand: price, advertising, distribution, and product quality. Let the variable x represent total marketing...
-
. In each case, determine whether or not the point lies on the line. If it does not, give an equation of a plane containing the point and the line. a. (-7, 10,-3) and r (t) = (1 - 4t, 6t - 5, t5) b....
-
1. What factors have played the biggest role in changing the dynamics of Super Bowl advertising in recent years? 2. Discuss the concepts of reach, frequency, and impact as they relate to Super Bowl...
-
Suppose a farmer can purchase liquid fertilizer at $5 per pound. The farmer can apply the fertilizer on either or both of two crops, cauliflower or cabbage. The expected extra benefit of the...
-
Changes in both the money supply and the velocity of money induce changes in aggregate demand.However, the long-term impacts of changes in these variables are different.How are the effects of an...
-
A segment of steel cable is 4.0 meters long and has a diameter of 2.0 cm. What is the spring constant of the cable?
-
The following information is available for Shanahan Company for the current year: The cash outflow to purchase Inventory through Accounts payable 2 5 0 , 0 0 0 Beginning Balance Ending Balance...
-
Major Assignments: Create Change (maximum value 50 points*) You are to develop a proposal consisting of strategies which attempt to accomplish all the following: Reduce the criminalization of persons...
-
Briefly explain basic recordkeeping requirements and discuss the importance of recordkeeping to employer and OSHA, and explain the use of OSHA forms 300, 300a, and 301. Describe a workers'...
-
In this module, we discuss fiscal policy and how it can be implemented in a recessionary gap or inflationary gap. Recently, COVID-19 has resulted in many government officials issuing executive orders...
-
1. As a general strategy, would you recommend that Carl take an aggressive approach to capacity expansion or more of a wait-and-see approach? 2. Should Carl go with the option for one facility that...
-
What are differentiation data?
-
List five guidelines for designing a corporate privacy policy for ecommerce applications.
-
List the three broad, horizontal levels of management in organizations.
-
Continuing to focus on evidence associated with the act, concealment, and conversion, use the evidentiary material to continue the examination. In addition, the examiner also starts to think of terms...
-
Consider the following cash flow profile and assume MARR is 10 percent/year. a. Determine the ERR for this project. b. Is this project economically attractive? EOY 0 2 3 4 5 6 NCF -$100 $15 $15 $15...
-
Quilts R Us (QRU) is considering investing in a new patterning attachment with the cash flow profile shown in the table below. QRU's MARR is 13.5 percent/year. a. What is this investment's external...
Study smarter with the SolutionInn App