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.

MSP430 DCO Library or Calibrated Values in Information Memory

Other Parts Discussed in Thread: MSP430F1232

Hi,


I am trying to calibrate the DCO at runtime using the external crystal. There is a TI application note, "slaa336a.pdf" ("Using the DCO Library") and it discusses using a library specially for this.

The trouble is that I cannot find the library anywhere. If I #include <DCO_Library.h> in IAR, the IDE cannot find it either. Does the library no longer exist?

Also, does the MSP430F1232 have calibrated DCO frequency values held in INFOA? My crystal frequency is 4MHz so the calibration function probably won't work properly anyway.


I want to calibrate the DCO for 4MHz at runtime so that if the crystal fails then the DCO has a chance to keep timings going somewhere near the desired frequency.

Thank you!

Nick.

  • Nick,

    You can find the zip download for slaa336 here.

    nick43oh said:
    Also, does the MSP430F1232 have calibrated DCO frequency values held in INFOA?


    No, the 1xx devices do not have calibrated values.

    Mike

  • I do not have any library nor sample code. But I do have a algorithm for you to write your own code. With this simple algorithm, you need to stop doing anything else for a few milliseconds to do the calibration. Is that acceptable?

    Note: no library, no sample code.
  • Thanks so much for your link. It is very much appreciated.

    You're right, INFOA. I had been working in INFOB! OK, this is also good to be certain about.

    Best regards, Nick.

  • Thanks for replying too. I will go ahead with the TI library but thank you very much for your offer.
    It is encouraging to know that TI has excellent support and a kind, helpful community. Unlike ST Micro, for example, which is sadly like a ghost town.
    Cheers, Nick.
  • Nick,

    Did you find an example or a library to adjust DCO frequency to 4MHz with a 4MHz crystal controlled clock as reference?
    Or did you have to use 32768Hz crystal controlled clock instead?

    --OCY
  • Hi OCY,

    In the end, I couldn't use the DCO Library to calibrate the DCO from the 4MHz crystal.

    Instead, I discovered the "fet120_fll_01.c" example (which I think might be the same as the DCO Library) and I modified it.

    I used a timer (capture mode, running off the crystal) to time a WDT interval (running off the DCO) and used portions of "fet120_fll_01.c" to adjust the DCO until "synchronisation" occured.

    Although I used polling, the WDT interval was so long that any resulting timing error was considered negligible.

    Thanks for all the help, everybody.

    Cheers, Nick.

  • I would be interessted in the algorithm. Would be  very nice, if you can supply it to me.


    Greetings,

    Sven

  • The original post of this thread was for MSP430F1232 using a 4MHz crystal as XT1 and wanted to maintain the DCO at 4MHz during runtime.

    In that case, one could use TimerA to count the DCO clock. Start and stop it according to WDT overflow when clocked by the XT1 generated 4 MHz. The resulting counts in TimerA could then be used to calculate the amount of adjustments for the current DCO settings.

    You may be interested in a different chip and have different requirements. If you tell me your situation, I may suggest a different approach.

**Attention** This is a public forum