Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 3 ? Use the delay assembly code from class ( Execution Time ) to generate a delay of 0 . 5 second. Note that

Task 3?
Use the delay assembly code from class (Execution Time) to generate a delay of 0.5 second. Note
that you may need to use a loop inside a loop to achieve the total delay. Then download the C code we
used in Lab 1. Using inline assembly, insert the delay sequence of instructions using asm {} in the main
function where the MSdelay (500) function is called, i.e. replace the MSdelay(500); line with the inline
assembly sequence. Note that you will not implement a function for the delay in this lab. Compile and
download this to the board and confirm that the LEDs blink on and off correctly.
Note that you may not be able to create the exact same delay in cycles, you want to be as close as
possible.
Entering inline assembly works like the following example. Use the "asm" keyword and include your
code between {} brackets.
asm
{ addd #1
addd #10
}
Answer the following questions:
1- How many cycles you will need to create a delay of 0.5 seconds?
2- How many iterations do you need to execute the loop on slide 5 to have a 0.5-second delay?
3- Does the answer for 2 fit in one HCS12 register? If not, what do you need to do to overcome
the problem?
4- Were you able to get the exact same cycles in delay? Why or why not?
5- What is the total delay time that you were able to create?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago