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.

Help: Adjusting the DCO frequency ?

Other Parts Discussed in Thread: MSP430F2417

Hello everyone,

I am using MSP430F2417 and i wanted to adjust the internal DCO frequency to 16 Mhz precisely. I am able to set it using the calibration data stored in INFO mem A segment. But I wanted to set the ferquency without using the caibration data. I have read the documentation but was not able to decide on the values to be put in the RSELx and DCOx.

The datasheet says that if i put values of RSELx =  15 & DCOx = 7 the freq. range is from 16MHz to 26 Mhz. What does this mean?

Thanks!

  • Many factors affect the DCO frequency for a certain DCO register setting. These include device supply voltage and temperature. Because of this, only frequency ranges are specified for DCO register settings so a specific frequency needs to be determined experimentally. The settings required for a given frequency may vary from device to device.


    Page 42 of the device datasheet http://focus.ti.com/lit/ds/symlink/msp430f2417.pdf shows the range of frequencies that can be acheived with different DCO register settings and can give you a good starting point for before experimentation. Please also note page 43 as well.

    Also precision can be increased using the FLL if an external crystal is connected to XIN/XOUT. Sample codes are available here  http://www.ti.com/lit/zip/slac151 and the setup is discussed in chapter 5 of the 2xx User's Guide http://focus.ti.com/lit/ug/slau144e/slau144e.pdf

    Finally it should be noted that although the DCO can reach frequencies that exceed 16MHz as you noted above the MSP430 cannot properly execute instructions at speeds greater than 16MHz.

  • Hi Brandon,

    Thanks for the reply. But do you mean to say that the DCO freq. can vary from 12 to 18.5 Mhz (RSElx = 15 & DCOx = 3) due to supply or temp. variations.

    If it is so then even if i set the DCO freq. value experimentally, there is no guarantee that it will remain constant. And if the variation is so huge all the timing of my code goes haywire?

    And one more question : How can we assert a software Reset in the code? I wanted to reset the controller if a flash violation or oscillator fault occurs?

    Thanks!

  • It is true accuracy can be an issue with the DCO, but there is characterization of the oscillator's response to temperature and voltage on page 45 of the datasheet. Also with temp and supply voltage constant you should see a stable frequency.

    Precision can be increased using a software FLL also.

    For a software reset, you could do one of the following:

    • Set the watchdog and allow the time to expire
    • Write the incorrect timer security key (security key violation)
    • Write the incorrect flash memory security key
    • execute a fetch from the peripheral address range

    All of the reset triggers are listed on page 24 of the 2xx User's Guide

  • Hi Brandon

    Thanks for the reply.

    The Characteristics given on page 45 are when calibration data of info. mem A is used. No characteristics are given when we load the RSELx and DCOx values manually. I do not want to use a Software FLL as it increases the code overhead. As it is, I am trying to port a code of size 120k from a 8051 based controller to MSP. I will have to make it fit in the available 92k Flash memory. I think that i will have to switch to an external crystal for better reliability.

    And about software reset - The methods given generates a PUC. What exactly is the difference between a PUC and a POR as far as the software is concerned.

     

**Attention** This is a public forum