C8051F340/1/2/3/4/5/6/7
14.5. System and USB Clock Selection
The internal oscillator requires little
14.5.1. System Clock Selection
The CLKSL[1:0] bits in register CLKSEL select which oscillator source is used as the system clock. CLKSL[1:0] must be set to 01b for the system clock to run from the external oscillator; however the exter- nal oscillator may still clock certain peripherals (timers, PCA, USB) when the internal oscillator is selected as the system clock. The system clock may be switched
14.5.2. USB Clock Selection
The USBCLK[2:0] bits in register CLKSEL select which oscillator source is used as the USB clock. The USB clock may be derived from the 4x Clock Multiplier output, a divided version of the internal oscillator, or a divided version of the external oscillator. Note that the USB clock must be 48 MHz when operating USB0 as a Full Speed Function; the USB clock must be 6 MHz when operating USB0 as a Low Speed Function. See SFR Definition 14.6 for USB clock selection options.
Some example USB clock configurations for Full and Low Speed mode are given below:
Internal Oscillator
Clock Signal | Input Source Selection | Register Bit Settings | |
USB Clock | Clock Multiplier | USBCLK = 000b | |
Clock Multiplier Input | Internal Oscillator* | MULSEL = 00b | |
Internal Oscillator | Divide by 1 | IFCN = 11b | |
| External Oscillator |
| |
Clock Signal | Input Source Selection | Register Bit Settings | |
USB Clock | Clock Multiplier | USBCLK = 000b | |
Clock Multiplier Input | External Oscillator | MULSEL = 01b | |
External Oscillator | Crystal Oscillator Mode | XOSCMD = 110b | |
12 MHz Crystal | XFCN = 111b | ||
| |||
*Note: Clock Recovery must be enabled for this configuration. | |||
|
|
| |
| Internal Oscillator |
| |
Clock Signal | Input Source Selection | Register Bit Settings | |
USB Clock | Internal Oscillator / 2 | USBCLK = 001b | |
Internal Oscillator | Divide by 1 | IFCN = 11b | |
| External Oscillator |
| |
Clock Signal | Input Source Selection | Register Bit Settings | |
USB Clock | External Oscillator / 4 | USBCLK = 101b | |
External Oscillator | Crystal Oscillator Mode | XOSCMD = 110b | |
24 MHz Crystal | XFCN = 111b | ||
|
Rev. 0.5 | 143 |