(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...
-
Consider again the end-of-chapter problem 8.9 about the impact of international trade on child labor in the developing world. A: Suppose again that households have non-child income Y , that children...
-
Juan Potter is an employee of Convergent Technologies whose job is strictly based in the companys office. His employer has authorized his use of the company vehicle for commuting purposes, as...
-
It is a Thursday. What day of the week will it be in 100 days?
-
Ferraro, Inc. established a share-appreciation rights (SAR) program on January 1, 2010, which entitles executives to receive cash at the date of exercise for the difference between the market price...
-
How would you apply the concept of risk and return in your daily decision-making processes? How might you explain the concept of risk vs. return trade-off during a shareholders' meeting? How would a...
-
Cassi Taxpayer (SSN 412-34-5670) who is single, has a home cleaning business she runs as a sole proprietorship. The following are the results from business operations for the tax year 2014: Gross...
-
Axel and Brooklyn have agreed to buy a new vehicle. Brooklyn mentions that she is looking forward to getting a new SUV, so they have room for their dogs and kids. Axel mentions he thought they were...
-
Research a company currently in the business news. Explain why it has been receiving media attention and describe the company's current financial condition compared to the rest of the industry....
-
A 6.010-2-T magnetic field passes through a circular ring of radius 5.4 cm at an angle of 17 with the normal. Part A Find the magnitude of the magnetic flux through the ring. Express your answer...
-
Summary of baked items sold monthly is mentioned below: Item Sales volume Sale price Cookies- 100 $7 Cupcakes- 100 $6 Muffins- 80 $8 Other N/A $600 (monthly total) Janny has projected monthly fixed...
-
Assume that the company adopts the Balanced Scorecard. After operating for a year, there are -improvements in some performance measures but not others. What should management do next? How does the...
-
Answer the following question about the advantages of the two different types of spreadsheet applications. i. Identify at least two advantages of using a cloud-based spreadsheet application such as...
-
The location of the first conference during World War II; the capital of Persia. 2 answers
-
What can you do to reduce hunger where you live? To reduce hunger globally?
-
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.
-
Imagine that you have \($10,000\) to invest. Use a newspaper, the Internet, or other source to select a mutual fund. Use the same source to fi nd out how much gold you could buy for \($10,000\)....
-
Animation art, hand-painted images from which cartoons used to be made, is a popular collectible.
-
The PBS television program, Antiques Roadshow, has generated enormous interest among viewers to find out the value of the furniture, art, jewelry, and collectibles they own.
Study smarter with the SolutionInn App