Jump to content
43oh

Precision 12 MHz clock for Launchpad MCU


Recommended Posts

The MSP430F1612 on the Launchpad provides a 12 MHz clock to the TUSB3410 chip. This clock can also be used by the MSP430 in the 20 pin socket.

 

Clock on pin 49 of F1612

post-2341-135135504583_thumb.jpg

 

Mask off pin 49 with Kapton tape and solder a 1k resistor to the pin.

Connect the other end of the resistor to the lower pad of C21 using a short wire.

 

post-2341-135135504571_thumb.jpg

 

This test program will flash the red LED five times with the DCO at ~1 MHz and then switch to the 12 MHz external clock.

 

#include "msp430g2231.h"

void main(void)
{
   unsigned i;
   volatile unsigned n = 0;

   WDTCTL = WDTPW | WDTHOLD;

   P1DIR = 0x01;
   P1SEL = 0x00;

   i = 10;
   do {
       P1OUT ^= 1;
       while(--n);
   } while(--i);

   BCSCTL3 = LFXT1S0 | LFXT1S1;        // - Set XT1 clock type as external
   do {                                // - Wait for MSP430 to detect clock is stable
       IFG1 &= ~OFIFG;                 // Clear OFIFG
       n = 250; while(--n);            // Wait a while
   } while(IFG1 & OFIFG);              // Loop until OFIFG remains cleared
   BCSCTL2 = SELM1 | SELM0 | SELS;     // - Use LFXT1CLK as clock source

   do {
       P1OUT ^= 1;
       while(--n);
   } while(1);
}

Link to post
Share on other sites
  • 2 months later...

I was made aware that the G series can accept an external clock despite the spec sheet saying it is not supported by this thread

 

When I was working on the CIR capture project, I tried using the clock from the FTDI chip. This worked with PIC, but the MSP430 was not happy with the stability and would at times switch back to internal osc.

 

So, after disappointing results with the FTDI clock, I used the 12 MHz clock on the Launchpad itself. This worked well. I didn't mention this in the project writeup because it made it dependent on the Launchpad or a oscillator module that seems to be very hard to find in a thru hole 3.3v variety (5V are common, but not 3.3).

 

Several months later there was some talk about this on IRC. My recollection of the IRC is that no one knew exactly how to do it. So I make this post to show how I had done it for my CIR project.

Link to post
Share on other sites
I was made aware that the G series can accept an external clock despite the spec sheet saying it is not supported by this thread

I just looked up the 2xxx family user guide (slau144h). It says

XT2CLK: Optional high-frequency oscillator that can be used with standard crystals, resonators, or

external clock sources in the 400-kHz to 16-MHz range.

and describes this in a little bit more detail on page 278. The TI page for e.g. the G2213 also explicitly states 'external digital clock source' as a feature (though the data sheet leaves XT2 as clock module out).

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.

Guest
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...