Question: Assume a 1 MHz clock frequency. Explain your computations for the following questions: a ) How long is the delay introduced by a single call
Assume a MHz clock frequency. Explain your computations for the following questions:
a How long is the delay introduced by a single call of the following subroutine Delay in seconds when DINIT times and DINITx
b How long is the delay introduced by a single call of the following subroutine Delay in seconds?
c Find a set of initial values for the registers dly dly dly and dly so that the Delay subroutine takes seconds with a error margin.
Write the Assembly code to initialize Port B bits and to outputs and bit to input. Then, write the code to read button from port B and display it at bit and its complement at bit of the same port.
What is the largest number of nested subroutine calls that can be implemented on an ATmega microcontroller without any external memory? How about with full external memory?
Consider the following code to answer the following questions. Assume that each call of longdelay takes milliseconds, and all other code takes no time at all. LOOP:
NOPRESS:
a Describe the situation that results in the shortest delay between any button on PinD being pressed and the LEDs turning off. Write down a timeline to show which code the processor executes and when. For example: mathrmt t: display complement of bit; t t: longdelay; t t: display complement of bit;
b Describe the situation that results in the longest delay between any button on PinD being pressed and the LEDs turning off. Write down a timeline to show which code the processor executes and when.
c Describe the situation that results in the longest time that button can be pressed and then released without the LEDs turning off. Write down a timeline to show which code the processor executes and when.
d Modify the code to run button readings and LED output in a more concurrent way by using FSMbased tasks.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
