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.

32KHz oscillator unstable when USB connected

When USB is not connected, I measure the stability of the 32KHz crystal oscillator at better than 0.1ppm. When I connect USB, the stability is worse than 100ppm. I see this on our custom PCA and on the TI demo board. Using MSP430F663x ICs and measuring the ACLK output with a 53131A Universal Counter. Experimenting with trigger sensitivity and the 100KHz filter lead me to believe this is not a measurement noise problem but actual fluctuations in the oscillator output.

Has anyone else seen this?

Has anyone checked 32KHz crystal oscillator stability with and without the on-chip USB active and NOT seen this?

Does anyone know of a fix or workaround?

  • This easily can be ground loop problem introduced by your measurement equipment. Try to connect isolated USB - using laptop running on battery, not connected to anything else but your board, then compare results.

  • I believe the 53131A input is isolated and this problem occurs both when the board is USB powered and when it is powered by an isolated power supply, so I think a ground loop is ruled out. This was an excellent suggestion though, and I tried it. I see no difference in the instability whether the laptop is plugged in or running on battery.

  • I assume that you measure ACLK output "correctly" - on "ACLK out" pin. Right? Then it could be thermal drift, power supply noise or crosstalk between signal and oscillator traces. I would check any changes in power supply ripple using scope, try to add extra low-ESR supply decoupling capacitors here and there, also would try to add some xtal (case) grounded shielding, check results.

  • Ilmars, I really appreciate your input on this problem.

    1. I am measuring on the designated ACLK out pin. The signal is clean and stable when USB is not connected. That said, the degree of instability I am observing is not detectable with an oscilloscope.

    2. I can rule out thermal drift. It's not drift, it's instability. I see an immediate change in the stability when I plug or unplug USB.

    3. I do think it's noise-related, but I suspect it is internal to the MSP430. 

    4. I can rule out crosstalk on my board because a) I routed the USB + and - as a differential pair and kept them well away from oscillator traces. The oscillator traces are short and not parallel with USB signal or power. And b) I observed identical instability on the TI demo board.

    5. I use extensive decoupling on every IC equal to or exceeding manufacturer specs. I use 0402 ceramic capacitors for 0.1 and 0.01uF caps. The board is 4 layers with a contiguous ground plane.

    6. I see noise spikes all over the board when USB is operating. They diminish when I use a very short ground line to the scope probe but they don't go away. 

    Again, I greatly appreciate the suggestions but at this point what would be most valuable to me is for someone else to report that they either do or don't see similar USB-induced instability in the 32KHz oscillator output. I am an experienced designer. I'm not saying it's impossible for me to be missing something, but I strongly suspect a problem with the MSP430 itself. What I am seeing can easily be duplicated by anyone with a USB port, high-quality counter/timer, and a demo board.

    Thank you,

    Clay

  • Do you test using supersimple firmware? - nothing else but code needed to perform oscillator instability test?

    Clay Weston said:
    but at this point what would be most valuable to me is for someone else to report that they either do or don't see similar USB-induced instability in the 32KHz oscillator output

    It takes proper hardware, interest and time :) Hopefully someone have all of those..

    Clay Weston said:
    instability in the 32KHz oscillator output

    You shall define instability.

    Clay Weston said:
    3. I do think it's noise-related, but I suspect it is internal to the MSP430. 

    I rather measure than think (assume). Do you have scope with clock measurement option/software - to measure characteristics of clock signal?

    Clay Weston said:
    6. I see noise spikes all over the board when USB is operating. They diminish when I use a very short ground line to the scope probe but they don't go away.  

    Supply spikes can be source of oscillator jitter indeed. Any chance to find source of spikes? Is it switching supply of your circuit, scope, freq counter, computer or just digital noise out uC itself? How can it be digital noise if decoupling caps are ok?

    Just two cents... Questions I would ask myself if I were you.

  • Clay Weston said:
    The signal is clean and stable when USB is not connected.

    "not connected" or "not operating"?

    If you connect USB to the PC, you usually establish a GND bridge to the PCs switchign supply. And to earth. The scope itself is also usually connected to earth, but often with a slightly different electrical potential due to wire resistance and induction and so on. This may cause measure inconsistencies (or even kill a device - I've had this once).

    However, more likely you have a HF crostalk that affects the LF crystal. Do you have guard traces around its traces? Is the case soldered to GND? If you have a GND plate below the crystal, is it insulated? (separated except for a small connection, so no GND currents flwo below the crystal)

  • Do you test using supersimple firmware? - nothing else but code needed to perform oscillator instability test?

     - good point. I'll try that

    It takes proper hardware, interest and time :) Hopefully someone have all of those..

     - it's not like this is some obscure function. I suspect a lot of people are using both the 32KHz oscillator and USB. Surely anyone using both should at least be curious about whether their own application has this problem

    I rather measure than think (assume). Do you have scope with clock measurement option/software - to measure characteristics of clock signal?

    - the only tool I have to detect a 100ppm discrepancy is the frequency counter. when I look at the signal with my scope I see nothing to explain the problem. You can't solve problems with measurements alone. You have to come up with hypotheses and test them. I'm trying to enlist help in testing my hypothesis. If other people have measured the clock frequency with and without USB connected, either they have observed this problem or not. If they have, it points to a problem with the IC. If not, it points to a problem with my design or measurement. As I said before, there must be plenty of people using both the 32KHz clock and USB. Anyone doing so should perform this test if only to make sure they don't have this problem

    Supply spikes can be source of oscillator jitter indeed. Any chance to find source of spikes? Is it switching supply of your circsupply of your circuit, scope, freq counter, computer or just digital noise out uC itself? How it can be digital noise if you say that decoupling caps are ok?

    - I have several switchers on the board. Plugging in USB does not change their input or loading, so they are not likely to be the cause of the problem. I have tested them over their full range of input voltage and output loading without seeing any effect on the 32KHz clock. 

    - I offer no explanation for how or why this could be a problem in the MSP430. I am only floating the hypothesis (okay, admittedly I called it a strong suspicion). If other people are having this problem then it is further evidence for the hypothesis regardless of whether you or I understand why it is happening.

    - Thanks again for your input Ilmars. It's worth a lot more than two cents!

    - Clay

  • Clay Weston said:
    when I look at the signal with my scope I see nothing to explain the problem

    You mean - when you look at the waveform on your scope? This is not how you measure clock jitter unless it is gigantic and needs no measurements :) I meant something like this.

    How counter behaves when you connect USB? It just steadily display slower or faster clock? If it's not steady - how erratic it is?

    If it's not thermal drift then I suspect something related to power - either due to oscillator power voltage change or supply noise.

  • You mean - when you look at the waveform on your scope? This is not how you measure clock jitter unless it is gigantic and needs no measurements :) I meant somethingl ike this.

    - I don't have a scope with that capability

    How counter behaves when you connect USB? It just steadily display sloweadily display slower or faster clock? If it's not steady - how erratic it is?

    - The frequency measurement updates a couple of times per second. When USB is not connected, the total difference between readings over a period of a minute or so is on the order of 0.1ppm. It's easy to see temperature effects if I heat or cool the board. With USB connected, the difference from one reading to the next is as much as 200ppm. This happens instantly when I connect USB. Some readings are higher, some are lower. There is no detectable pattern.

    - I tried counting clock pulses over a 1 second period. Without USB connected, I get repeatability within 0.1ppm. With USB connected, the number of pulses counted jumps up and down randomly each second just like it does in the frequency measurement mode.

    - The phenomenon is not a gradual drift. It is an instantaneous increase by 3 orders of magnitude in the instability of the frequency measurement. Because I see the identical problem with a demo board, I can be confident it is not caused by switching power supplies on my board. Oscillator power is regulated within the MSP430.

    - Again, I'm sure other people are using USB and depending on the stability of the 32KHz clock. Unfortunately none of them seem to be reading this thread. .


  • Please tell which development board you use. Also post your test code (as file attachment), preferably whole IAR project.

  • Have you resolved this issue?  We also want to use the 32KHZ xtal for USB.  

    After more reading, it seems apparent I cannot use the DCO for USB, so I will put a 24MHz crystal in the design. 

  • Check out the application report "MSP430 32-kHz Crystal Oscillators" SLAA322 - it is full of excellent advice.

  • I know this thread is old, but I wanted to share my solution. I added ferrite chip inductors (Bourns MH1608-221Y) to all 4 USB lines. I connected USB ground to my device ground through an inductor (not directly). After I did this, the 32KHz clock signal does not change when I connect USB. Thanks to all for your suggestions.

    Regards,

    Clay

  • Thanks for sharing your solution. It doesn't matter that the thread is a bit older. (I've seen MUCH older threads being reactivated, usually with another question, sometimes not even related).
    If someone searches the forum for this problem, he now will find your solution.

    Likely, the USB has some influence on the supply lines (mainly the GND level), and this will have some influence on the trigger point of the oscillator circuit, causing some jitter on individual clock pulses.
    Since the MSP is only operating at full speed (1.5MHz), the ferrite inductors are indeed a good way to keep transients away without blocking the USB operation.

**Attention** This is a public forum