Hello!
I just had a look at TI page, they write (for G2x series):
Basic Clock Module Configurations
Internal Frequencies up to 16 MHz With Four Calibrated Frequency
Internal Very-Low-Power Low-Frequency (LF) Oscillator
32-kHz Crystal
External Digital Clock Source
So if there are pre calibrated frequencies, it should be extremely easy to use them.
Beside this, there is a command to increase or decrease the DCO (which is the way
of making an FLL control). If you want a certain multiple, then you can use a timer
on the DCO frequency. Use a timer to measure DCO with 32k crystal reference. If
the number you get on timer interrupt is less than the multiple you want, then increase
DCO, otherwise decrease. Once you found the right value, you're done. HINT: you can
store this value in flash to use it next time. Or you can use the pre calibrated values
if they fit your needs.
By the way, look at TI code, there are many examples for using the clock system.
Edit on June 6th:
I just had a look at TI source code (launch pad related = slac467a.zip).
The following setting allows you to set a 16 MHz clock (factory calibrated). Of course,
it's a multiple of 32768 and therefore not exactly 16 MHz but very close.
as 16MHz/32768 = 488.28125, and as the modulation allows you to reduce the
interval by 8 (not sure, please verify), you will be set to 488.25 and the error will
be 64 ppm which is quite acceptable. If you use no modulation, you will be close
to 600 ppm from the target 16 MHZ, which is still quite acceptable, but this depends
on what you want to do.
Code:
BCSCTL1 = CALBC1_16MHZ; // Set range
DCOCTL = CALDCO_16MHZ; // Set DCO step + modulation
Dora.