PLEASE ANSWER ALL 5 QUESTIONS What is the difference between oneshot and periodi
ID: 2081298 • Letter: P
Question
PLEASE ANSWER ALL 5 QUESTIONS
What is the difference between oneshot and periodic timers? What does_time_add_sec_to_ticks function do? What does the timers counter overflow interrupt source do? Suppose that a microprocessor is sourced with 32678 Hz clock, and a 16-bit register is incremented by one after every increasing clock tick. How many ticks must have occurred when the 15th bit changes to a Logic 1, and how many seconds have passed by that time? With the clock source and register described above, what would the prescalar value be to achieve 8 seconds delay? (1/2 1/4 1/8 1/16 1/32).Explanation / Answer
1. In Periodic mode, timer schedules for every t seconds. The value of t is fixed. A task that is scheduled to run at a certain moment will run at some multiple of T
In one shot mode of timer, scheduler examines all the runnable threads and selects the one scheduled to run earlier and sets up the timer to do scheduling again at that time
2. time_add_secs_to_ticks function on execution adds the given number of seconds (input) to clock value and updates the clock
3. When the timer counter reaches maximum value in bits(i.e. if the timer is of 8 bits,then it's maximum value(prescalar) is 255), then the timer needs to go back to zero. At this point timer overflow interrupt occurs.
In the timer control register,we have clock select bits using which we can change the prescalar value.timers counter overflow interrupt source allows you to change the prescalar value
4. Time taken for 1 tick = 1/f = 1/32678= 3.06E-5secs
After 16384 ticks,for the 16385th tick 15th bit of the register changes. By that time 16,384/32,678 = 0.501 seconds have passed.
5. The technique of frequency division is called prescalar.
To get a delay of 8 secs, the prescalar we use is 1/8
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.