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.

MSP430F2272 16mhz ADC

Hi guys,

 

I am currently using the built-in ADC of the MSP430 and was wondering can I use the external 16 MHZ crystal for taking readings.

I only want to use the external 16 Mhz crystal for ADC readings to achieve quick results and use the internal 1Mhz crystal for everything else to save power.

Is this possible?

 

Here is the code i have written so far, but it is altering the master clock to 16mhz. I just just want to set it up as ACLK.

 

void init_16Mhz_adc(void){

volatile unsigned int i;

WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

BCSCTL1 |= XTS + DIVA_0; // ACLK = (LFXT1 = HF XTAL)/1

BCSCTL3 |= LFXT1S1; // LFXT1S1 = 3-16Mhz

do

{

IFG1 &= ~OFIFG;                         // Clear OSC fault flag

i = 0xFF;                               // i = Delay

while (i--);                            // Additional delay to ensure start

}

while (OFIFG & IFG1);                     // OSC fault flag set?

BCSCTL2 |= SELM_3 + SELS;                 // MCLK = SMCLK = LFXT1

WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

ADC10CTL1 = INCH_1 + CONSEQ_1 + ADC10SSEL_1;// A1/A0, repeat multi channel

ADC10CTL0 = ADC10SHT_0 + MSC + ADC10ON + ADC10IE + REF2_5V + SREF_1+REFON;

ADC10AE0 = 0x03;                           // P2.0,1 ADC option select

ADC10DTC1 = 0x2;                         // 2 conversions

}//void init_16Mhz_adc(void){

 

Am i doing something wrong or can this even be done?

  • The maximum frequency for ADC10 is specified on page 49, and is 6,3Mhz when ADC10SR=0. The current in ADC10 specified on page 46 is count with the ASC10OSC at 5.0MHz so it is possible to use the ADC10 without other "external" high frequency, this lets the availability to leave the MSP430 in LPM3 during converison (handle with an interrupt) to spare power (MCLK disabled, ACLK running low frequency).

    An other important point is the sampling time required for the load, the calculation is presented on page 20-8 of the user guide. But for example, the internal temperature sensor requires an minimum sampling time of 30us (datasheet page 50).

**Attention** This is a public forum