Consider a PIC32 having a peripheral clock frequency of 10 MHz operating in 16-b
ID: 2079729 • Letter: C
Question
Consider a PIC32 having a peripheral clock frequency of 10 MHz operating in 16-bit Synchronous Clock Counter mode. Let N be the Pre-Scale value, and let P be the Period Register Value.
a. With what frequency (in Hz) will a timer register “roll over” (that is, increment from P to 0) if N = 16 and P = 24999?
b. If N = 32, then what value of P will cause a roll-over frequency that is as close as possible to the frequency you calculated in part (a)?
c. Explain why choosing a pre-scale value of N = 1 would be a bad idea for generating the roll-over frequency you calculated in part (a).
d. Which type of timer – Type A or Type B – is capable of performing the tasks described in parts (a) and (b)? Briefly explain why only one timer type or the other can perform as required, or why either timer type can do the job.
Works shown please
Explanation / Answer
(a). Sine the PIC32 is operating in 16-bit synchronous clock mode,
Timer register roll-over frequency = (Fclk)/((65535-24999)*16) ,Fclk = 10Mhz
=15.41Hz
(b).If N=32
then (Fclk)/((65535-P)*32) = 15.41
65535-P = 20268
P = 45267
(c). If you chose prescale valuse of 1 then to generate roll-over frquency of 15.41hz then you need a value of 648929 in period register, For this, you need to use 32-bit timer. That's why this is bad idea.
(d). Type-B timer havs to be used to perform tasks mentioned in (a) and (b). Because, Type-A timer doesn't have software selectable prescalars of 1:16 and 1:32
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.