Problem 1. The PIC32MX oscillator and clocks are described in section 6 of the P
ID: 2268029 • Letter: P
Question
Problem 1. The PIC32MX oscillator and clocks are described in section 6 of the PIC32 Reference Manual: Section 6. Oscillators (Microchip, document DS61112H). Figure 6-1 in section 6 of the Reference manual shows how the Primary oscillator, Posc, is used to derive the System Clock, SYSCLK, the Peripheral Bus Clock, PBCLK, and the USB clock, USBCLK. For the following assume an 8 MHz crysta s used as the primary oscillator. (a) Describe how the oscillator system for the PIC32 ca be configured to obtain a 40 MHz 11s SYSCLK (b) With the SYSCLK asin (a) describe how the oscillator system for the PIC32 is configured to obtain a PBCLK so that SYSCLK=4x1)BCLK. c) With the clocks configured as in (a) and (b), if we initialize the core timer Count register to 0 how much time will elapse until it rolls over and returns to 0?Explanation / Answer
(a) To Configure SYSCLK to 40 MHz.
-- COSC = 011 = Primary Oscillator with PLL module
-- div x = FPLLIDIV = 001 = Divide by 2
-- PLL = PLLMULT = 101 = Clock is multiplied by 20
-- div y = 001 = PLL output divided by 2
Now, Output SYSCLK = ( ( Posc/div x) * PLL ) / div y = ( ( 8 / 2 ) * 20 ) / 2 = 4 MHz
Here, Note that input frequency (Fin) to PLL must be between 4 MHz to 5 MHz. In above case, Fin = 4 MHz.
(b) To configure SYSCLK = 4 x PBCLK.
-- Postscaler div x = PBDIV = 10 = PBCLK is SYSCLK divided by 4
(c) The core timer register incrementes every two system clock (SYSCLK). The register size is 32 bit.
-- The time required for core timer to reache 0 again = Total Count x Time for One Count = 2^32 x (2/ SYSCLK) = 214.7483648 sec
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.