The busclk you can use to calculate setupr reqisters for is within interval from1MHz to 50MHz for temperature range from -40deg.C. to +150deg.C. Over this temperature range max bus frequency is limited to 40MHz.
Calculation is simple. you can either select as a source clock internal 1MHz oscillator or some external oscillator.
On the basis of used oscillator and configuration of the circuitry you can select between PEI, PBE and PEE modes.
PLL Engaged Internal (PEI)
— This is the default mode after System Reset and Power-On Reset.
— The Bus Clock is based on the PLLCLK.
— After reset the PLL is configured for 50MHz VCOCLK operation.
Post divider is 0x03, so PLLCLK is VCOCLK divided by 4, that is 12.5MHz and Bus Clock is
- 6.25MHz.
The PLL can be re-configured for other bus frequencies.
— The reference clock for the PLL (REFCLK) is based on internal reference clock IRC1M.
• PLL Engaged External (PEE)
— The Bus Clock is based on the PLLCLK.
— This mode can be entered from default mode PEI by performing the following steps:
– Configure the PLL for desired bus frequency.
– Program the reference divider (REFDIV[3:0] bits) to divide down oscillator frequency if
- necessary.
– Enable the external oscillator (OSCE bit).
– Wait for oscillator to start up (UPOSC=1) and PLL to lock (LOCK=1).
• PLL Bypassed External (PBE)
— The Bus Clock is based on the Oscillator Clock (OSCCLK).
— The PLLCLK is always on to qualify the external oscillator clock. Therefore it is necessary to
make sure a valid PLL configuration is used for the selected oscillator frequency.
— This mode can be entered from default mode PEI by performing the following steps:
– Make sure the PLL configuration is valid for the selected oscillator frequency.
– Enable the external oscillator (OSCE bit).
– Wait for oscillator to start up (UPOSC=1).
– Select the Oscillator Clock (OSCCLK) as source of the Bus Clock (PLLSEL=0).
— The PLLCLK is on and used to qualify the external oscillator clock.
The calculation of setup registers is realy simple by formulas presented in capters
- 8.3.2.2 S12CPMU_UHV_V6 Synthesizer Register (CPMUSYNR)
- 8.3.2.3 S12CPMU_UHV_V6 Reference Divider Register (CPMUREFDIV)
- 8.3.2.4 S12CPMU_UHV_V6 Post Divider Register (CPMUPOSTDIV)
The only you have to think about is that BUSCLK = fpll/2 for PEI and PEE modes and fosc/2 in the PBE mode.
The example for CPMU setup in the PEI mode is presented in the reference manual:
- 8.7.3 Application Information for PLL and Oscillator Startup
If you would like to help with calculation for specific case you want to use do not hesitate to reply.
If this does not answer your question(s), or I have forgotten something, or if you need more assistance, please contact me again.
- This issue will auto close in 7 days upon no reply.
Best Regards, Ladislav