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.

MSP430I2020: How to configure external clock input?

Part Number: MSP430I2020

Hello,

I want to use MSP430I2020 with external clock input. I have attached an 4Mhz oscillator, and i confirm it outputs the correct clock signal.

this is the code I used:

void main(void)
{
volatile unsigned int i; // Use volatile to prevent removal
// by compiler optimization
WDTCTL = WDTPW + WDTHOLD; // Stop WDT



CSCTL0 |= DCOBYP; // External Oscillator 4Mhz
CSCTL1 |= DIVS__16; // SMCLK = DCO/4


P1DIR |= BIT0 | BIT1; // P1.0, P1.1 Output
P1SEL1 |= BIT0 | BIT1; // MCLK, SMCLK Pin Function
P1SEL0 &= ~(BIT0 | BIT1);

....

Using an oscilloscope on pin P1.1, I get the clock signal with frequency 712Khz and taking into account that it is divided by 16, it results the frequency of  11.39MHz which is the frequency of internal oscillator (uncalibrated).

Please, tell me how to configure the clock system to use the external clock oscillator instead of the internal one.

  • I found the error. 

    This is the new code:

    void main(void)
    {
      volatile unsigned int i;                  // Use volatile to prevent removal
                                                // by compiler optimization
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
    
      P2SEL1 |=  BIT0;        // MCLK, SMCLK Pin Function
      P2SEL0 |=  BIT0;
      CSCTL0 |=  DCOBYP;                          // External Oscillator 4Mhz
    
      CSCTL1 |=  DIVS__16; 

  • Hello,

    Nice job figuring out the issue. Thanks for posting the solution to benefit others in the E2E community.

    If you're planning to use the SD24 ADC module, the external digital clock frequency in DCO bypass mode must be 16.384 MHz for the SD24 module to meet the specified performance in the datasheet. I just wanted to point that out.

    Regards,

    James

**Attention** This is a public forum