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.

MSP430F2122 - XT1 doesn't run with crystal

Other Parts Discussed in Thread: MSP430F2122

Hi all,

I am trying to run an MSP430F2122 with an 12 MHz crystal on XT1, but without success. The oscillation doesn't start.

Here is my code, it's like in the example:

   WDTCTL = WDTPW + WDTHOLD;                 // Stop Watchdog Timer

    BCSCTL1 |= XTS;                           // ACLK = LFXT1 = HF XTAL
    BCSCTL3 |= LFXT1S1;                       // 3 – 16MHz crystal or resonator

    do
    {
      IFG1 &= ~OFIFG;                         // Clear OSCFault flag
      for (i = 0xFF; i > 0; i--);             // Time for flag to set
    }
    while (IFG1 & OFIFG);                     // OSCFault flag still set?

    BCSCTL2 |= SELM_3;                        // MCLK = LFXT1 (safe)

The oscillator flag OFIFG is always on.

The device is powered with 3,4V. I can see into the controller with the FETU430IF.

The capacitors next to the crystal are 15 pF. I tried with and without series resistors between 200R and 4k7, also in combination with a parallel resistor of 500k and 1Meg. The voltage at the XOUT pin rises at 0.8 V, not more. But the XT1 doesn't oscillate!

If I am working with the DCO, the controller works fine.


What can be the cause for XT1 not to run?


Thanks in advance for the help!

Hans

  • TI has advises about the layout of XIN and XOUT. Check your PCB layout.

    You may also try a different crystal of the same frequency. 

  • Your code for the XT init looks correct. Have you declared i as volatile for not getting optimized away by the compiler? Although I cannot imagine that this is the reason for the crystal not to work properly.

    But ocy pointed it out, the layout for crystals is relatively important, too. Did you try another capacitance like 27pF or something like that? Is it a breadboard or do you have a PCB for your circuit? If so, can you show the layout?

    Dennis

  • Thanks for the replies.

    i is declared al volatile. In fact this part of the code is a copy of the example code.

    I tried also another type of crystal already, also having another frequency. Also I played around with caps like 4,7p, 10p, 15p, 20p. I will try also 27p.

    About the layout: This is an already running project e where the CPU is clocked from the DCO at 16 MHz, means that there is no external oscillator yet. Now I want to reduce the power consumption using a low power mode > 2.

    I have a periodical interrupt each 100µs. The timer for this is now clocked from the DCO. But when using power modes > 2 the DCO is stopped, so I need another clock to run the timer for the periodical interrupt.

    That is why I now need XT1. So there is no layout in the pcb for the crystal. The crystal, as well as the caps and the resistors, are now connected with very short wires to the ports of the controllers and to GND. And yes, it is tricky to to keep the wires short and I put very much attention in doing this.

    It is iteresting that the voltage on XOUT rises strait to 0,8 V, not more, and remains there. There is no attempt for an oscillation to be seen on the scope. This is what surprises me at most. It seems to me as if the oscillator is kind of disabled!

    Thanks in advance for further help!

    Hans

  • In most cases you can see the voltage swing with an oscilloscope, but keep in mind that you are adding a lot of parasitics by hooking your cable to the pins which can also disturb your oscillation.

  • According to the User's Guide, if XTS=1, XCAPx should be 00 but you have 01.

    If you are aiming at low power, you shouldn't use XTS=1 to begin with. 

  • Thanks!

    @Dennis: I am aware that the probe can disturb the oscillation, but it doesn't oscillate even whithout scope. The code doesn't exit the while loop.

    @old_cow_yellow: indeed, XCAPx is initiallized 01. I was'nt aware of that! I will change the setup an come back again.

    Hans

  • Hans Gierlich said:

    ... This is an already running project e where the CPU is clocked from the DCO at 16 MHz, means that there is no external oscillator yet. Now I want to reduce the power consumption using a low power mode > 2.

    I have a periodical interrupt each 100µs. The timer for this is now clocked from the DCO. But when using power modes > 2 the DCO is stopped, so I need another clock to run the timer for the periodical interrupt.

    That is why I now need XT1. ...

    I am not sure which is more important to you: (a) using a low power mode > 2, or (b) reduce the power consumption.

    If and when you add a 12 MHz crystal controlled XT1, you will be able to do (a) but totally defeat (b).

    Adding 12 MHz XT1 and in LPM3 will consume a lot more power as compared to your working board in LPM0.

  • The target is to reduce power consumption. It doesn't matter for me in which mode. I wanted to give it a try with XT1.

    As the DCO is stopped in LPM >= 2, I thought of clocking the timer with XT1, but at a lower frequency, say about 1 MHz or even lower. It's just that I don't have actually other crystals than 12 and 16 MHz. But to see if it works in priciple, they should do it. I am aware that the power consumption depends on the frequency. So, at the end of the day I have to figure out, what mode and frequency will help me reach the target.

    I tryed with XCAPx = 0, but it didn't help.

    In a next step will repace the controller. Maybe there is something damaged in the oscillator circuitry. Even though I don't really beleive in the success of this...

    What could be the explanation that the oscillator output rises to 0.8 V an not more? If enabled, I would expect the output to rise at a HI level.

    Thanks, Hans

  • Adding a 12MHz crystal and use XT1 in high speed mode takes a lot of power (could be thousands of uA). Much more than the power saving you get in turning off DCO.

    On the other hand, adding a 32768 Hz watch crystal and use XT1 in low speed mode takes very little power (a few uA). But in this case, your Timer can only generate interrupts every 91.5 or 122 usec (not 100 usec).

  • Well, with cheap 1:1 probes you likely will stop the oscillation. At least use a compensated 10:1 probe. However, what you see will still not be what is there without probing. We bought a special 0.9pF active FET probe (~$600) for investigating crystal problems.

    It's possible that the crystal oscillates but still doesn't give a clock signal. The analog oscilaltion circuit may have an oscillation, but its amplitude might be too low to drive the digital part of the oscillator cicuit. The usual cause is a wrong load capacitance. Also, there is a chance that you got an overtone crystal that now oscillates on base frequency. (in rare ases, these are are sold for frequencies above 10MHz, but usually only for much ihgher frequencies)
    Note that each cap on both sides of the crystal needs to be twice the load capacitane, minus parasitic trace capacitances.

**Attention** This is a public forum