Jump to content

MSP430 clock calibration vs ADC - overlooked problem?

Recommended Posts

I was trying to make an accurate measurement of the internal temperature sensor (MSP430G2553). For this the ADC calibration values are stored in the Info Memory, also called TLV. To pick the right value first the tag needs to be searched and then a location based on an index array is calculated. Investigating this matter I browsed through the register definition file of CCS and found that not only the ADC calibration is stored in such a way but also the clock calibration.


However, when using the clock calibration I have never seen a program going through the process of searching the info memory for the specific tag and then taking the indexed position. It always looks like this:


That makes me wondering if this is using the correct values from the info memory? Or why can the clock calibration values be picked that easy from the info memory and not the ADC calibration?



The register definition shows this:

/* TLV Calibration Data Structure */
#define TAG_DCO_30             (0x01)         /* Tag for DCO30  Calibration Data */
#define TAG_ADC10_1            (0x08)         /* Tag for ADC10_1 Calibration Data */
#define TAG_EMPTY              (0xFE)         /* Tag for Empty Data Field in Calibration Data */

SFR_16BIT(TLV_CHECKSUM);                      /* TLV CHECK SUM */
SFR_8BIT(TLV_DCO_30_TAG);                     /* TLV TAG_DCO30 TAG */
SFR_8BIT(TLV_DCO_30_LEN);                     /* TLV TAG_DCO30 LEN */
SFR_8BIT(TLV_ADC10_1_TAG);                    /* TLV ADC10_1 TAG */
SFR_8BIT(TLV_ADC10_1_LEN);                    /* TLV ADC10_1 LEN */

define CAL_ADC_25T85          (0x0007)       /* Index for 2.5V/85Deg Cal. Value */
#define CAL_ADC_25T30          (0x0006)       /* Index for 2.5V/30Deg Cal. Value */
#define CAL_ADC_25VREF_FACTOR  (0x0005)       /* Index for 2.5V Ref. Factor */
#define CAL_ADC_15T85          (0x0004)       /* Index for 1.5V/85Deg Cal. Value */
#define CAL_ADC_15T30          (0x0003)       /* Index for 1.5V/30Deg Cal. Value */
#define CAL_ADC_15VREF_FACTOR  (0x0002)       /* Index for ADC 1.5V Ref. Factor */
#define CAL_ADC_OFFSET         (0x0001)       /* Index for ADC Offset */
#define CAL_ADC_GAIN_FACTOR    (0x0000)       /* Index for ADC Gain Factor */

#define CAL_DCO_16MHZ          (0x0000)       /* Index for DCOCTL  Calibration Data for 16MHz */
#define CAL_BC1_16MHZ          (0x0001)       /* Index for BCSCTL1 Calibration Data for 16MHz */
#define CAL_DCO_12MHZ          (0x0002)       /* Index for DCOCTL  Calibration Data for 12MHz */
#define CAL_BC1_12MHZ          (0x0003)       /* Index for BCSCTL1 Calibration Data for 12MHz */
#define CAL_DCO_8MHZ           (0x0004)       /* Index for DCOCTL  Calibration Data for 8MHz */
#define CAL_BC1_8MHZ           (0x0005)       /* Index for BCSCTL1 Calibration Data for 8MHz */
#define CAL_DCO_1MHZ           (0x0006)       /* Index for DCOCTL  Calibration Data for 1MHz */
#define CAL_BC1_1MHZ           (0x0007)       /* Index for BCSCTL1 Calibration Data for 1MHz */
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...