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.

msp430F2132 DCO calibration example does not work

Other Parts Discussed in Thread: MSP430F2132, MSP430G2152
I have been trying to re-run the DCO calibration on an MSP430F2132 to replace the values in an accidentally erased info flash section.
I started by trying the MSP430F20xx Demo - DCO Calibration Constants Programmer example and it worked on a MSP430G2152
However when I try it on the MSP430F2132 the program gets stuck in an infinite loop at the "Wait until capture occurred" stage.
I'd assumed that this is caused by some minor difference in either the clock or Timer between the two variants of the processor, but despite reading the books carefully I can't see what I'm doing wrong.
Has anyone got a working DCO cal example for the F2132 please?
Colin
  • >Has anyone got a working DCO cal example for the F2132 please?
    Indeed. Not on F2132, but they don't differ much. Most probably problem is not variant of the chip but something else like reference clock. As you sure that 32KHz clock is running?
  • > As you sure that 32KHz clock is running?

    The processor is part of a Ham Radio transceiver that works - so yes I'm sure it physically works.
    However, the radio firmware is written in assembler and built on the IAR workbench.
    My clock cal code is in C and built on Linux with mspgcc. I can take a look at the init code and see if there is something different.

    thanks.
  • Okay, I think my problem is that I don't understand how this works in theory. I realise we are trying to count DCO cycles in an external 4kHz clock pulse. But how does the timer sync with the ext clock? and what is being 'captured'? If I was writing code to do this I'd probably try reading the DCO count register on successive Ext Clock interrupts to get the number of DCO cycles.

    What am I missing here?
  • > I realise we are trying to count DCO cycles in an external 4kHz clock pulse.

    Where do you got 4KHz? msp430x21x2_dco_flashcal.c comments:

    // Description: This code re-programs the F2xx DCO calibration constants.
    // A software FLL mechanism is used to set the DCO based on an external
    // 32kHz reference clock. After each calibration, the values from the
    // clock system are read out and stored in a temporary variable. The final
    // frequency the DCO is set to is 1MHz, and this frequency is also used
    // during Flash programming of the constants. The program end is indicated
    // by the blinking LED.
  • > Where do you got 4KHz?

    It's a 32kHz ext clock and the divide ratio is set to 8

**Attention** This is a public forum