Question: Problem The program given below implements a general - purpose delay loop. The clock frequency of the Arduino microcontroller that is running the program is

Problem The program given below implements a general-purpose delay loop. The clock frequency of the Arduino microcontroller that is running the program is f=20 MHz, and the number of clock cycles for each instruction is given. Assume that the value of the variable Repetitions can be any integer number between 1 and 32767.
int Count1=Repetitions; /5 clock Cycles
While (Count1>=0)/15 clock Cycles
{ int A=0; /5 clock Cycles
Int A+=1; /10 clock Cycles
Int A-=1; /10 clock Cycles
Count1= Count1-1; /10 clock Cycles
}
For the following questions write all your calculations on the space provided
i. Which is the clock period?
ii. Which is the Minimum delay that can be implemented by the general purpose delay loop?
iii. Which is the maximum delay that can be implemented by the general purpose delay?
iv. Which value should be the Count1 in order to measure a 2 second delay?
v. If Count1=1000, What will be the delay implemented ?
vi. If the type for the variable Repetitions is changed to byte what would be the value of the maximum delay that can be implemented?

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!