Table 1-22. Clock Control (CLKCTL) Register Field Descriptions (continued)
Bit
Field
Value
Description
0
OSCCLKSRCSEL
Oscillator Clock Source Select bit. This bit selects the source for OSCCLK. On XRS low
and after XRS goes high, internal oscillator 1 is selected by default. The user would
need to select external oscillator or internal oscillator 2 during their initialization process.
Whenever the user changes the clock source using these bits, the PLLCR register will be
automatically forced to zero. This prevents potential PLL overshoot. The user will then have
to write to the PLLCR register to configure the appropriate PLL multiplier value. The user
can also configure the PLL lock period using the PLLLOCKPRD register to reduce the lock
time if necessary. If the missing clock detect circuit detects a missing clock, then this bit is
automatically forced to 0 and internal oscillator 1 is selected. The PLLCR register will also
be automatically forced to zero to prevent any potential overshoot.
0
Internal oscillator 1 selected (default on reset)
1
External oscillator or Internal oscillator 2 selected. Note: If users wish to use oscillator 2 or
external oscillator to clock the CPU, they should configure the OSCCLKSRC2SEL bit first,
and then write to the OSCCLKSRCSEL bit next.
(1)
The internal oscillators are software trimmed with parameters stored in OTP. During boot time, the boot-ROM copies this value to the
above registers.
1.3.2.3.1 Switching the Input Clock Source
The following procedure may be used to switch clock sources:
1. Use CPU Timer 2 to detect if clock sources are functional.
2. If any of the clock sources is not functional, turn off the respective clock source (using the respective
CLKCTL bit).
3. Switch over to a new clock source.
4. If clock source switching occurred while in Limp Mode, then write a 1 to MCLKCLR will be issued to exit
Limp Mode.
If OSCCLKSRC2 (an external Crystal [XTAL] or oscillator [XCLKIN input] or Internal Oscillator 2 [INTOSC2]) is
selected as the clock source and a missing clock is detected, the missing clock detect circuit will automatically
switch to Internal Oscillator 1 (OSCCLKSRC1) and generate a CLOCKFAIL signal. In addition, the PLLCR
register is forced to zero (PLL is bypassed) to prevent any potential overshoot. The user can then write to the
PLLCR register to re-lock the PLL. Under this situation, the missing clock detect circuit will be automatically
re-enabled (PLLSTS[MCLKSTS] bit will be automatically cleared). If Internal Oscillator 1 (OSCCLKSRC1) should
also fail, then under this situation, the missing clock detect circuit will remain in limp mode. The user will have to
re-enable the logic via the PLLSTS[MCLKCLR] bit.
1.3.2.3.2 Switching to INTOSC2 in the Absence of External Clocks
For the device to work properly upon a switch from INTOSC1 to INTOSC2 in the absence of any external clock,
the application code needs to write a 1 to the CLKCTL.XTALOSCOFF and CLKCTL.XCLKINOFF bits first. This
is to indicate to the clock switching circuitry that external clocks are not present. Only after this should the
OSCCLKSRCSEL and OSCCLKSRC2SEL bits be written to. Note that this sequence should be separated into
two writes as follows:
First write → CLKCTL.XTALOSCOFF=1 and CLKCTL.XCLKINOFF=1
Second write → CLKCTL.OSCCLKLSRCSEL=1 and CLKCTL.OSCCLKSRC2SEL=1
The second write should not alter the values of XTALOSCOFF and XCLKINOFF bits. If
C2000Ware
, supplied by
Texas Instruments is used, clock switching can be achieved with the following code snip:
SysCtrlRegs.CLKCTL.all = 0x6000; // Set XTALOSCOFF=1 & XCLKINOFF=1
SysCtrlRegs.CLKCTL.all = 0x6003; // Set OSCCLKLSRCSEL=1 & OSCCLKSRC2SEL=1
The system initialization file DSP2806x_SysCtrl.c, provided as part of
C2000Ware
also contain functions to
switch to different clock sources. If an attempt is made to switch from INTOSC1 to INTOSC2 without the write to
the XTALOSCOFF and XCLKINOFF bits, a missing clock will be detected due to the absence of external clock
System Control and Interrupts
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
75
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......