I am using the freescale stack and am running the demo program. The USB clock is set up the to use the MCGPLLSCLK for the USB clock source. The clock initialization starts to use the external reference clock for the MCGOUT. The last line of the clock initialization changes MCGOUT to also come from the PLL. This should not be required as the USB gets its clock source from the PLL clock as the USB stack code sets the USB_CTRL register to use the PLL clock ( IE USB_CTRL=0x03) . When I take out this line from the end of the clock setup, the USB stops working : The line is MCGC1 &= 0x3F;
I cant have this as my projects needs a slower clock frequency to conserve power. I thought that is what using the PLL clock for USB enables you to do.
To complicate it a bit more the reference manual says:
7.4.8 Fixed Frequency Clock
The MCG presents the divided reference clock as MCGFFCLK for use as an additional clock source. The
MCGFFCLK frequency must be no more than 1/4 of the MCGOUT frequency to be valid. When
MCGFFCLK is valid then MCGFFCLKVALID is set to 1. When MCGFFCLK is not valid then
MCGFFCLKVALID is set to 0.
This clock is intended for use in systems which include a USB interface. It allows the MCG to supply a
48MHz clock to the USB. This same clock can be used to derive MCGOUT. Alternately, MCGOUT can
be derived from either internal or external reference clock. This allows the CPU to run at a lower frequency
(to conserve power) while the USB continues to monitor traffic.
When I view the clock diagram and read the rest of the documentation, I dont see any ties from the MCGFFCLK to USB. The diagram only shows to sources of USB clock - MCGOUT and MCGPLLSCLK.
Any help would be appreciated. I need to run USB at 48 mhz and MCGOUT at much less as the manual says you can do.