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.

MSP430FE42xA Crystal slow down

Other Parts Discussed in Thread: MSP430FE427

Hi,

I am working on a board using MSP430FE42xA. The whole circuit works perfectly fine: gives appropriate values and UART works.

But, when I plug in the device for measurement, the device slows down significantly: The rate at which my LED glowed earlier slowed down, the UART wasn't giving any valid data.

Can someone please help me on why this could happen? Is there any way to solve it?

Thanks,
SF 

  • S Fighter said:
    But, when I plug in the device for measurement, the device slows down significantly:

    Could be a time distortion field generated by the flux generator in the measurement unit. No? Well, then how about giving some more informations?
    Where do you the device plug in for measurement? What do you measure and how? What is the setup of the device? I guess form the thread topic that you're using a crystal somewhere and somehow. But where and how? What crystal?

    To get a specific answer you'll need to ask a specific question. A general question can only get general answers.

  • Hi Jens,

    I'm sorry that I wasn't more specific. MSP430FE42xA is a Power Meter IC. It has an embedded chip - ESP430CE (analog front end), which calculates the power values when given voltage and current input channels. It has a 16 bit ADC and the ESP does all the calculations without disturbing the MSP430 core. The calculated power values are stored onto a register, which can be read my the MSP430.

    I have followed the circuit given in this Application Note: http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa203c&docCategoryId=1&familyId=914

    This MSP430 requires a 32.768kHz crystal. I have used a crystal with 6pF load capacitance.

    So, when I plug in the device to the AC outlet for the measurement, I observe the slow down in the crystal that I explained  in my previous post. I still see measurement values being generated in the registers, but they are generated at a much slower rate too.

    Possible causes to the problem:

    - The crystal in my board is quite close to the 120VAC line coming for measurement.This might cause interference and slow down the crystal. The V+, V- pins are next to the crystal pins in the IC, so its difficult to maintain a distance between them.

    - The supply Voltage is not steady. I did measure the supply voltage (output from a 3.3V LDO Regulator) using a Multimeter, and it was quite stable. I also have 0.1uF and 10uF 0603 Caps across both AVSS, AVDD and DVSS, DVDD.

    It might be also that the crystal slow down is not caused because of this MSP430 alone. Any other causes of slow down will also help me investigate further.

    Also, any method which will help me debug this better will also help. Please let me know if you can think of anything.

    Thanks,
    SF 

  • Ah, okay, with 'plug in for measurement' you mean you're applying AC to the power meter part of the MSP.
    We have a power meter too, but there the analog front end is an ADE7758 with an electrically isolated SPI connection for the transfer of the register contents. So I'm not new to the problems. The ADC takes a 10MHz crystal, but luckily, the engineers designed the ADE so that the AC pins are on one and the digital pins on the other side, so the crystal is far away from the live side. Since this isn't possible in your case, an isolating GND line aroudn the crystal area is the only other option. Don't move the crystal too far away from the processor pins. The shorter the better.

    Due to the much higher impedance, teh 32kHz crystal is much more prone to EMI injection. It is possible that the newar AC line has some influence. A good idea is to place the crystal as close as possible to the MSP pins and draw a GNS line around it (upper and lower side of the PCB) but keep the area below the crystal (both PCB sides) clear to reduce parasitic capacitance. You won't believe how much the PCB layout adds to the load capacitance. And works as antenna for EMI.

    Are you sure the crystal is slowing down? Or are you just experience a reduction of interrupts per second in your timer ISR or such? It is possible that the code execution time increases as soon as there are some 'real' values to handle. This may exceed the time between two interrupts and result in apparently slowed-down action. Or the number of interrupts from the data source increases beyond the number in  'idle' condition. This shouldn't normally affect data sending (do you receive nothing or just meaningless bytes? Maybe a send buffer overflow). But it is possible.

    The supply voltage is anothe rthing. Keep in mind that the device deals with 120V AC. What about polarity? Maybe your device is floating on 120V and device GND is not neutral. This can have various effects, from unreliable data connection up to device destruction.
    Also, having a live wire near may cause your supply voltage to swing. A Multimeter won't tell you as it shows average apparent power. What does the multimeter tell if you measure your supply voltage in AC mode? Even better is the use of an oscilloscope.

    In our device, we had a 1000:1 divider for the AC input (3 phases). The large part was a 1MOhm wired resistor (SMD resistors aren't good for 220V) and as far as possible away from the ADE chip. The 1kOhm for the sivided voltage, however, was placed near to the imput pin and GND, makign a low-impedance shortcut for any EMI.

    If your crystal has 6pF load capacitance, you'll need to apply 12pF on each side to GND. The MSP pins have 1-2pF and any wire will add to it. Including any wire on the opposite side of the PCB. Any change of the capacitance will make the crystal frequency instable. It has a high impedance (and the MSPs driver circuit is optimized for an impedance >50kOhm). Unfortunately, capacitance, especially in-circuit, is almost impossible to check.

    YOu can try the following: try applying lower voltages (if you have an adjustable transformator, it would be best). Try outputting the crystal signal to a port pin and check with a frequency counter. Check the  the supply voltage with an oscilloscope.

    Using 0805 caps instead of 0603 is often better because of the lower ESR. Also using NPO0 instead of X7R caps is an advantage for blocking any high-frequency influences. The 10µF cap on AVSS could be a tantalum one, parallel with a good ceramic 100nF.

  • Hi,

    Thanks a lot for your input.

    I scoped out all the signals last night and observed some interesting things.

    - The Power Supply is at a steady 3.3V. Our GND is connected to the Neutral. I also connected the MSP to an external Supply, and the crystal was still 'slowing down'.

    - I also removed all the measurement and UART code. Just blinked the LED. The slow down was still there. So, I eliminated a slow down in the execution of MSP.

    - I removed the crystal entirely. The MSP worked now in the 'slow mode'. So, the crystal was not slowing down. But, because of some interference, the MSP was not able to lock onto the frequency.

    - When I scoped out the signal from the crystal, I saw it gave a good 32kHz sinusoidal signal from about -150mV to +150mV. However, when the board was plugged in, there was a DC shift in the signal of about 150 mV. I believe the MSP was not able to lock onto this signal.

    - Also, I did not have put any load capacitance as the design didn't suggest any. I thought the parasitics would provide enough capacitance.

    I will try out the things that you suggested, and report back, hopefully, with a working device.

    Thanks again,
    SF 

  • SF,

    There's a software fix for your load-capacitance shortage.  Set the XCAPxPF field in FLL_CTL0 for 6pF (setting = 01).

    Actually if you're lucky that fix could be all you need!

    Jeff

  • Hi Jeff,

    I am using the software to set FLL_CTL0 to 6pF. Unfortunately, the device still malfunctions.

    Ideally, I should not be putting any load capacitances outside the chip if I'm setting it in software? Please let me know.

    Thanks,
    SF

  • You're correct.  If you are using software to configure the MSP430 for 6pF loading, you don't need any external capacitors.  It's a very nice solution.

    Unfortunately, it looks like you are going to have to look at the layout, grounding, and guarding.  JMG had great suggestions above, and I would also recommend this classic from TI:

    http://focus.ti.com/lit/an/slaa322b/slaa322b.pdf

    By the way, the UART failure and the "slow down" are a direct result of the XT1 failure.  Once you solve the XT1 failure, the other problems will disappear.  The FLL is slowing down the DCO because XT1 isn't working properly.  (Your LED blinking and your UART baud rates are apparently based on the DCO rate.)

    Good luck!

    Jeff

  • Jeff Tenney said:
    If you are using software to configure the MSP430 for 6pF loading, you don't need any external capacitors. 

    I fear that the layout is forming a capacitor with way more than the required 6pF.
    Also, it seems to work as antenna and charges due to the near AC line.

    Jeff Tenney said:
    UART failure and the "slow down" are a direct result of the XT1 failure.

    I forgot about the FLL. Indeed. It's likely not the crystal slowing down, it's the FLL which slows down the DCO because there are 'too many' DCO pulses coming in between the last crystal pulse and the (perhaps never coming) next one. So the FLL will step down the DCO until it reaches the lowest setting. This of course slows down everything.

    As a test, the timer interrupt should check for the OFIFG flag or maybe one of the other fault flags (DCOF, LFOF or whatever they are named) and set an LED if one comes up.
    One check would be to disable the FLL once the device is up and the nominal DCO frequency is achieved. Check the datasheet how to do it. Once the DCO has settled, the FLL is only necessary to stabilize over temperature changes. If you disbale the FLL once the device is running, plugging it in for measurement shouldn't affect the speed anymore. Of course this is not a solution, just a test.

  • hi.

    i am using MSP430fe427 and i have same problem. my crystal has a problem. it is not working properly. i tried it this code:

     

    #include "msp430fe427.h"

    volatile unsigned int i;

    void main(void)

    {

      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

      FLL_CTL0 |= XCAP18PF;                     // Configure load caps

      IE2 |= BTIE;                              // Enable BT interrupt

      BTCTL = BT_ADLY_1000;                     // 1s Interrupt

      P1DIR |= 0x30;                            // P1.4 and P1.5 output

     

      // An immedate Osc Fault will occur next

      IE1 |= OFIE;                              // Enable Osc Fault

     

      while(1)

      {

        _BIS_SR(LPM3_bits + GIE);               // Enter LPM3 w/ interrupts

        P1OUT ^= 0x20;                          // Toggle P1.5 using exclusive-OR

      }

    }

     

    // Basic Timer interrupt service routine

    #pragma vector=BASICTIMER_VECTOR

    __interrupt void basic_timer(void)

    {

      P1OUT ^= 0x20;                            // Toggle P1.5 using exclusive-OR

    }

     

    #pragma vector=NMI_VECTOR

    __interrupt void nmi_ (void)

    {

      do

      {

        IFG1 &= ~OFIFG;                         // Clear OSCFault flag

        for (i = 0xFFF; i > 0; i--);            // Time for flag to set

        P1OUT ^= 0x10;                          // Toggle P1.4 using exclusive-OR

      }

      while ((IFG1 & OFIFG));                   // OSCFault flag still set?

      IE1 |= OFIE;                              // Enable Osc Fault

    }

    On my board the led on P1.4 is always blinking. and OFIFG is set...
       

     

  • Hi,

    I designed a new board with the ground plane, and other precautions suggested by Jens. Also, I did not stuff the external capacitors, as they could be set by software.

    The crystal worked perfectly this time. Thank you so much for helping me out!

    I think the problem was that my AC lines were pretty close to the crystal, and were causing interference. As Jeff mentioned, the interference would have caused the FLL to malfunction.

    @omeraygor: I used the software given by TI in the Application Note: http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa203c&docCategoryId=1&familyId=914

    The crystal worked fine with the given code.

    - SF

  • hi SF

    thanks. The board i designed is grounded and also i havent still work with AC line. can you send me a picture of PCB you designed including crystal and MSP. 

     

    Thanks.

    Omer Aygor

  • hi 

    i have a question more. you said "I designed a new board with the ground plane". i think my problem is same with you. my card has only one side grounded. (bottom side)

    top side is not grounded. you know crystal pins and V and I pins is so close. 

    both side, top and bottom copper must be grounded around the crystal. 

    does the ctystal body touch the ground plane? 

    thanks....

**Attention** This is a public forum