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.

MSP430G2231: MSP430G2231 is configured with 12MHZ CLK

Part Number: MSP430G2231


Hi Team,

We are using MSP430G2231 and the in the code, we included the header file msp430x20x2.h and the clock is configured as 12MHZ.

BCSCTL1 = CALBC1_12MHZ + DIVA_2;
DCOCTL = CALDCO_12MHZ;

I was going through some of the related threads and got to know that MSP430G2231 has only 1MHZ Clk. 

Also verified the location to check if the calibrated data during manufacture has configured it to 1MHZ and below is the memory dump.

0x10E0: FF FF FF FF FF FF FF FF FF FF 10 10 FF FF FF FF | ................
0x10F0: FF FF FF FF FF FF FF FF FF FF FF FF 01 02 B2 86 | ................

Looks like 0x10FF is having 86 which is 1MHZ. 

Please correct me if I am wrong. 

Is this fine, if we calibrated data has proper configured clock, or do we have to change in the code flow.

Thanks a lot for the help.

 

  • The msp430g2231 has only one calibrated DCO frequency, at 1MHz. [Ref data sheet (SLAS694J) Table 9]. That would be at ox10fe-ff, and it appears to be present on your device. If it had a 12MHz calibration, that would be at 0x10fa-fb, which does not appear to be present [Ref user Guide (SLAU144J) Table 24-1]. (The bytes at 0x10fc-fd, which would be the 8MHz calibration, look more like a TLV header than calibration bytes, so I would say it is not present.)

    msp430g2231.h contains definitions for CAL[DCO/BC1]_1MHZ, but not the others, since they are presumed to not be present. If you include the header for some device other than the one you're using, you may get unexpected results (beyond just the DCO constants).

    If you have a 32kHz crystal for a reference, you can use Example msp430g2xx1_dco_flashcal.c to fill in the other 3 calibrations:

    https://dev.ti.com/tirex/explore/node?node=AGeBo9U1AUUzQGZ.RVQpaw__IOGqZri__LATEST

  • Hello,

    Thanks a lot for your quick response.

    I have one more point to clear.

    1. If the Information memory is 0xFF then by default MSP430G2231 will consider the 1MHZ Clock?

    2. Also we are using SMCLK and external reference voltage for ADC, since the 1MHZ Clock is not configured properly will ADC has any impact in sampling the data?

    ADC10CTL0 = SREF_0+ADC10SHT0+ADC10SR+MSC+ADC10ON+ADC10IE+ENC+ADC10SC+REFOUT;
    ADC10CTL1 = INCH_4+ADC10DIV_7+ADC10SSEL_3+CONSEQ_2;

    Your inputs help us in understanding the behaviour of MSP430G2231.

    Thanks in advance.

    Regards,

    Swarna.N

  • 1) If the calibration value is 0xFF (erased) you must not use it. As I recall, this results in a very high clock speed that exceeds the chip specifications. Some of the TI examples check for this explicitly and halt the program. This sort of thing can (also) happen if you accidentally erase the InfoA segment. (Personally, I think it's a mistake for them to put something into the 8MHz constants which is not =0xFF.)

    The CPU doesn't use any of these values on its own. At reset, the clock (DCO) is running at something "vaguely resembling" 1MHz. (I've seen  0.9-1.1MHz.)

    The only calibrated clock speed your program can set is 1MHz, using CAL[DCO/BC1]_1MHZ. It cannot set a calibrated 12MHz. 

    2) The DCO affects SMCLK (ADC10SSEL=3), so if the DCO isn't calibrated it would have some effect (+/-10% maybe) on the ADC sample/hold time, but perhaps not enough to be visible. 

  • Thanks a lot for your inputs.

**Attention** This is a public forum