This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DCO and BCS calibration constants not available in MSP430f5438

Other Parts Discussed in Thread: MSP430F2274, MSP430G2553, MSP430F5438, MSP430DRIVERLIB

Hi TI people,

I have been through some examples of code for ADC12 in msp430g2553,msp430f2274.

and i had seen some lines like

DCOCTL = CALDCO_8MHZ; // Load 8MHz constants
BCSCTL1 = CALBC1_8MHZ;

why are these registers used and

what is the use of calibration constants.

and how can i set these registers in msp430f5438 which doesn't have these registers.

THANK YOU IN ADVANCE

  • Any reference code for setting these valves in msp430f5438 will be most helpfull??

    THANK YOU IN ADVANCE
  • Hi Sunil,

    The G2xxx and F5xx have different clock modules.

    The G2xx has a simpler DCO which adjust the frequency based on the contents of these 2 registers. It's possible to calibrate this DCO as discussed in this AppNote: http://www.ti.com/lit/an/slaa336a/slaa336a.pdf.
    But TI makes it easier for customers by providing pre-calibrated values which are calculated during production and stored in some specific locations (mentioned in the datasheet).
    So, when you load these values, you are simply setting the clock at the corresponding frequency (with the tolerance described in the datasheet) and the value of these registers will remain constant but the clock might drift due to voltage or temperature.
    In theory, you can re-calibrate the DCO during your application to achieve higher accuracy.

    The F5xx includes a FLL which stabilizes the DCO frequency. It's similar to a continuous hardware re-adjustment of the DCO. The FLL can be disabled and the DCO could be calibrated using the same approach used for the G2xx, but that would defeat the purpose of the FLL, right? So, due to the fact that the F5xx has the FLL, it doesn't need the pre-calibrated values and you just use FLL multipliers and dividers to select the output frequency.

    There are several code examples for G2xx and F5xx here: http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/msp/tools_software.page#code.
    Check msp430x54xA_UCS2.c or msp430x54xA_UCS3.c.

    Or better yet, for the F5xx try using DriverLib which has functions to configure the clocks and other peripherals: http://www.ti.com/tool/MSP430DRIVERLIB.


    Regards,
    Luis R
  • THANK  YOU LUIS R you response is very helpful.

  • It should be added, that 5x family, in opposition to 4x family (which also has an FLL), provides a calibrated reference (REFO) that is used as reference clock for the FLL by default. So the FLL can be used out-of-the box (and does so for default 1MHz MCLK) as long as the precision of the REFO is good enough.
  • Like what every one stated, the 2x series and 5x series are not the same.

    The 2x wakes up at around 1.1Mhz and you can leave it at that if you don't care that it's not 99% accurate to 1Mhz.

    TI at the Factory run each chip and test what values would be best for 1,8,12 and 16Mhz and store them in InfoA.
    some low end G2x does only have 1MHz stored, but the compiler should warn you that define for CALDCO_8MHZ is not available.

    As InfoA can be erased by mistake you should:
    if ( CALDCO_8MHZ !=0xFF){DCOCTL = CALDCO_8MHZ} else {DCOCTL= defaultvaluefor8Mhz}
    As it's better that the code go on working at around 8MHz than not work at all.

    The 5x Series use a 32KHz external crystal or laser-trimmed internal RC oscillator(REFO) and PLL(PhaseLockLoop)/FLL to get pretty accurate 1MHz

    So the difference is that 2x use software values to get calibrate, and the 5x have its hardware calibrated instead.

**Attention** This is a public forum