MSP430F149IPM 晶振问题

你好,

这是一个客户的问题。

现象:MCU采用外部硬件看门狗电路,硬件看门狗电路输出正常的复位信号(通过示波器测量复位信号的高低电平均正常)。该复位信号输入到MSP430芯片后,MSP430晶振无法正常起振。(用示波器测量晶振信号为直流电平。无源晶振不起振现象为偶发现象,并非每块板卡都会,概率:几十次出现一次)。测量MCU电源未发现异常,查看晶振PCB走线,走线很短,阻抗50Ω,包地良好,且无源晶振附近无其他信号线。

单片机晶振外围电路如附件所示

可以帮忙看一下吗?

谢谢!

  • 您现在上传的不是外围电路吧?

    If a post answers your question, please mark it with the "verify answer" button.

    若是回复解决了您的问题,请点击“是”确认答案。谢谢!

  • 贴一下我之前收藏的晶振问题的回答:

    晶振的正常工作需要一定的激励功率来维持,晶振可以看做一个负载。如果负载超过激励功率的能力,这个系统就是不稳定的,可能会停振。特别实在低温情况下会出问题。

    这个实际的负载大小与三个因素有关:

    1. PCB layout

    2. 匹配电容容值

    3. 晶体本身的谐振阻抗

    通常问题出在1和2上面。即不好的PCB layout和不合适的匹配电容。

    那么如何保证1和2呢?

    1. PCB layout :不要冒险让XTAL到MCU PIN的距离超过8--10mm,通常小心的设计需要在5mm之内。长的引线会大大引入ESD风险。

    2.匹配电容 : 匹配电容偏大,会使起振时间偏长,振幅降低。匹配电容偏小,频率会不稳定,同时低温会停振。把一个板子放冰箱里半小时就有可能观察到了。 选择方法 : 不同的匹配电容,对应的XTAL的震荡频率是不同的。通常让XTAL达到标称频率点,是晶振比较健康的工作状态。 实际可以把XTAL配置成ACLK,然后从MCU ACLK引脚输出,通过频率计来观察XTAL的频率,然后调整匹配电容值。 以32.768K XTAL为例,如果发现ACLK 频率偏大,就减少匹配电容值,反之亦然。

    如果调整好了PCB layout和匹配电容,如何评估我的晶振系统是否稳定?

    在量产之前是完全可以评估晶振电路的风险的。 需要关注一个关键值, SF(Safe Factor,安全因子),SF可以衡量激励功率的裕度。通俗来讲,如果搬一个10斤的重物,你的力气是30斤,那么SF = 30 /10 = 3. 如果你的力气是50斤,那么SF = 50 / 10 = 5; 那么搬一个10斤的重物绰绰有余了。

    SF 越大越好,我的经验是MSP430的SF可以设计到5以上,不太会出晶振方面的问题。

    SF的测试方法 : 在晶振引脚和MCU 引脚之间串入一个电阻RQ,比如100Kohm, 观察ACLK的稳定度,如果ACLK稳定,那么增加RQ,比如150Kohm,再观察ACLK,持续增加RQ,直到ACLK异常为止。 SF = 1 + (RQ/ 晶振谐振阻抗)。晶振谐振阻抗可以在晶振的spec中查到,常见的有25Kohm ,35Kohm,50Kohm,70Kohm

    如果你的板子SF < 3,就 有很大风险。 SF >5 ,通常会比较安全了。

    If a post answers your question, please mark it with the "verify answer" button.

    若是回复解决了您的问题,请点击“是”确认答案。谢谢!

  • 回复 Emma Wang:

    请结合数据手册内的说明并结合晶振生产商的数据 试一下不同的匹配电容

    If a post answers your question, please mark it with the "verify answer" button.

    若是回复解决了您的问题,请点击“是”确认答案。谢谢!

  • 回复 Emma Wang:

    另外代码内XTS要重新配置成1来使能XT1的高频功能。

    /* --COPYRIGHT--,BSD_EX
     * Copyright (c) 2012, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *******************************************************************************
     * 
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //  MSP-FET430P140 Demo - Basic Clock, MCLK Sourced from HF XTAL
    //
    //  Description: Proper selection of an external HF XTAL for MCLK is shown by
    //  first polling the OSC fault until XTAL is stable - only then is MCLK
    //  sourced by LFXT1.  MCLK is on P5.4
    //  ACLK= MCLK= LFXT1= HF XTAL
    //  //* HF XTAL NOT INSTALLED ON FET *//
    //  //* Min Vcc required varies with MCLK frequency - refer to datasheet *//	
    //
    //                MSP430F149
    //             -----------------
    //         /|\|              XIN|-
    //          | |                 | HF XTAL (455k - 8Mhz)
    //          --|RST          XOUT|-
    //            |                 |
    //            |             P5.4|-->MCLK = XTAL
    //
    //
    //  M. Buccini
    //  Texas Instruments Inc.
    //  Feb 2005
    //  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
    //******************************************************************************
    
    #include <msp430.h>
    
    int main(void)
    {
      volatile unsigned int i;
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
      P5DIR |= 0x10;                            // P5.4= output direction
      P5SEL |= 0x10;                            // P5.4= MCLK option select
      BCSCTL1 |= XTS;                           // ACLK= LFXT1 = HF XTAL
    
      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)
    
      for (;;);                                 // Do nothing
    }
    

    If a post answers your question, please mark it with the "verify answer" button.

    若是回复解决了您的问题,请点击“是”确认答案。谢谢!

  • 回复 Emma Wang:

    晶振的负载电容貌似太大了。常见的8MHz晶振,一般用几pF到10几pF。具体要根据晶振的数据手册来选择。


    昵称:灰小子

    qq:1358611172