• AVR Freaks

Helpful ReplyHot!"Frozen" SOSC in PIC24FJ128GA705

Page: 123 > Showing page 1 of 3
Author
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
2021/01/24 23:08:56 (permalink)
0

"Frozen" SOSC in PIC24FJ128GA705

Hi,
I use  PIC24FJ128GA705 with RTCC running from SOSC. Most devices work OK, but some have SOSC "frozen" until I touch a crystal pin with tweezers or oscilloscope probe. This was observed in several cases in a batch of about 30 devices.
 
After such a kick start device works OK. But when I remove power and then power-up device, SOSC does not start again.
 
I tried to apply a 2 MOhm resistor across watch crystal. For some "sleepy" devices it helped, after power-up SOSC started without tweezers. But it was at least one occasion when such a resistor did something bad and device misbehaved until I removed it.
 
Devices are battery powered. Rail voltage is 2.5V with a 0.5F supercap across the rail. Thus, rail voltage rise rate is quite slow. At the power-up program sets SOSCEN bit as recommended by datasheet:
 
"To avoid delays for peripheral start-up, the SOSC can be manually started using the SOSCEN bit"
 
SOSC operates in "high power" mode:
 
#pragma config SOSCSEL = ON
#pragma config SOSCHP = ON   

Crystal is MS3V-T1R-32.768kHz-12.5pF-20PPM-TA-QC from Micro Crystal:
  • load capacitance 12.5 pF
  • ESR 50k typ, 65k max
  • static capacitance 0.9 pF
Crystal loading capacitors 22 pF, C0G
 
The same watch crystal and the same rail arrangement was used in devices based on PIC24FJ128GA306. We never had a single problem over the years and hundreds devices manufactured.
 
Any help would be highly appreciated.
post edited by a_kouz - 2021/01/24 23:10:26
#1
dan1138
Super Member
  • Total Posts : 4324
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/25 02:13:15 (permalink)
5 (1)
Your post contains quite a lot of good information but low power crystal oscillator circuits using 32.768KHz watch crystals are notoriously hard to validate.

Microchip does not usually provide sufficient details about the oscillation amplifier specifications to create an accurate simulation model.

The only practical design method available is to construct the sample circuit using the actual PCB layout and test the oscillator performance.

I can only speculate as to why your circuit behaves in the way you have described.

Most likely is that you are driving your watch crystal with too much power. According to the data sheet this is a 1 microwatt crystal.

To accurately measure your crystals performance requires some uncommon oscilloscope probes and test fixtures. Should you have these things you will be able to verify if my guess has any merit.
#2
oliverb
Super Member
  • Total Posts : 441
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/25 02:52:25 (permalink)
5 (1)
Might be worth looking at: https://www.microchip.com/forums/m1001373.aspx
Also https://www.nxp.com/docs/en/application-note/AN3208.pdf
 
I notice a suggestion to take a working unit and add resistance in series with the crystal to find out how much start-up "margin" you have.
 
I'm also wondering if you have too much load capacitance, 2*22pF in series would be 11pF. Add some stray C and it might be over 12.5pF?
 
#3
MBedder
Circuit breaker
  • Total Posts : 6988
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/25 03:59:06 (permalink)
5 (1)
Wash and dry your PCB thoroughly after assembly. The 32K resonators require a fairly high impedance between the PCB SOSCx traces to maintain high Q factor value.
#4
oliverb
Super Member
  • Total Posts : 441
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/29 06:56:37 (permalink)
0
I also had a look at the crystal specifications available, there were parts with a 30K ESR, which might be more responsive. The resistor observation is interesting, though my understanding is that the required resistance could exceed 10M.
#5
ric
Super Member
  • Total Posts : 30244
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/29 14:02:31 (permalink)
0
oliverb
... The resistor observation is interesting, though my understanding is that the required resistance could exceed 10M.

Which observation?
I think you are referring to parallel resistance, whereas in post#3 oliverb was referring to series resistance.

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
RISC
Super Member
  • Total Posts : 6067
  • Reward points : 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/01/29 14:22:04 (permalink)
0
Hi,
Devices are battery powered. Rail voltage is 2.5V with a 0.5F supercap across the rail. Thus, rail voltage rise rate is quite slow.

This may be out of spec....look at parameter DC17A ( Recommended VDD Rise Rate )
Regards

For support make sure to check first here : http://microchipdeveloper.com
There are hundreds of PIC, AVR, SAM...which one do YOU use ?
#7
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/01 22:18:33 (permalink)
0
Hi guys,
Sorry for late response, we had troubles with internet connection. Thank you for your suggestions.
 
> Wash and dry your PCB thoroughly after assembly.
Agree, it is important. SMD parts where soldered by professional subcontractor, boards are clean.
> look at parameter DC17A
Over the years we used supercap across the rail rail in several thousands devices, and we never had problems. But those devices employ PIC24FJ64GB004 and PIC24FJ128GA306. The problem appear when we started to use PIC24FJ128GA705.
--------------------
There are several devices with problems out of 10 tested so far. This is what I expect from a device:
(a) After power-up (slow rail rise, POR enabled) oscillator should work
(b) When I touch SOSCI pin with oscilloscope probe 1:10 oscillator should not stop working
Device #1.
Test (b) fails. When I changed capacitor at SOSCO from 22pF to 15pF or to 10pF, test (b) still fails. Tests passed when I put 5.1MOhm resistor across the crystal.
Device #2.
Test (b) fails. Tests passed when I put 5.1MOhm resistor across the crystal. 
Device #3.
Test (a) fails. Also test (a) fails if put 5.1MOhm resistor across the crystal. Tests passed when I changed capacitor at SOSCO from 22pF to to 10pF, or when I put 2MOhm resistor across the crystal.
Device #4.
Passed both tests. Test (a) fails if put 5.1MOhm resistor across the crystal. Test (b) fails if changed capacitor at SOSCO from 22pF to 15pF or to 10pF.
--------------------
Therefore, at the moment I do not know a solution suitable for all devices, eg good for production. So far I have to test devices and modify them manually, either adding resistor or by changing capacitor.  Maybe I can find something better later on.
 
#8
ric
Super Member
  • Total Posts : 30244
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/01 22:23:27 (permalink)
0
Do you understand what series resistance is? It sounds like you might be overdriving the crystal.

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#9
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/01 23:27:55 (permalink)
0
> you might be overdriving the crystal.
 
It is unlikely. Rail voltage is only 2.5V, swing at SOSCO is about 1V. At some stage I tried to put SOSC into "low power mode", this PIC has such a feature.  But it was even worse. 
 
I said before, we've built many devices with exactly the same crystal and never had problems. But we used other PICs.
 
Nevertheless, tomorrow I'll try to add a resistor in series with SOSCO pin.
#10
dan1138
Super Member
  • Total Posts : 4324
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/01 23:33:42 (permalink)
0
a_kouz
... The problem appear when we started to use PIC24FJ128GA705. ...

There are some issues with the PLL, internal oscillator and clock switching with the PIC24FJxxxGA7xx devices.
 
I suspect that the area of the chip where the oscillation amplifiers are located may have "issues".
 
It looks like you are stuck as I cannot find any pin compatible controllers that you could try.
 
Maybe try an external 32.768KHz clock chip like the DSA6101JL2B-032K768VAO
#11
rpg7
Super Member
  • Total Posts : 1445
  • Reward points : 0
  • Joined: 2003/11/07 12:47:35
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/02 02:11:09 (permalink)
0
I have had some luck when making the SOSCO cap larger than the SOSCI cap. Try SOSCO 22pF and SOSCI 10pF
#12
Howard Long
Super Member
  • Total Posts : 908
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: online
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/02 03:41:36 (permalink)
5 (1)
Have you properly cleaned the boards in an ultrasonic cleaner with detergent targeted at flux & ionics?
 
My regime is ultrasonic cleaner with Electrolube SWAS at about 40C, then two rinses in deionized water.
#13
oliverb
Super Member
  • Total Posts : 441
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/02 06:39:56 (permalink)
0
If the oscillator appears to need a resistor from pin to pin then there may be an actual issue with that PIC. As far as I'm aware the PIC's oscillator includes an internal feedback or bias "resistor" to ensure that the circuit biases correctly, but if you build your own oscillator out of a logic gate then it is up to you to provide a resistor to bias the logic gate into its linear region.
 
If the PIC wasn't providing feedback then it could get into a "locked" state where the input was near ground or supply, and the output was at the opposite rail and unable to amplify. If the input pin "leaked" to VDD or ground that could also block it, and might explain why specific resistor values could sometimes fix it.
 
It might be worth trying to measure the DC bias points, I know that a standard probe will disrupt the oscillator but even so you'd expect to see roughly VDD/2 average on input and output on a classic CMOS-inverter Pierce oscillator unless the oscillator includes voltage regulation.
 
#14
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/02 18:04:27 (permalink)
4 (1)
> you might be overdriving the crystal
As promised, I've added a resistor in series with SOSCO pin on a prototype board. In original state board was OK, eg it passed both tests (a) and (b) described above. Regarding to resistor value results are as follows:
100k  - There is no difference, the board passed both tests. Signals at SOSCO and SOSCI look pretty much the same as in original configuration. Signal after the resistor looks more sinusoidal, as expected.
270k - Board fails both tests. Once started by touching SOSCO pin with tweezers, oscillator works. When started, oscillator works after MCLR reset, even if I keep MCLR=0 for half a minute. It is the same behaviour as for other boards failing test (a).
1M - There is no oscillations.
 
> Have you properly cleaned the boards
While boards look qute clean,  additionally I cleaned some failing test (b)  boards by isopropyl alcohol. It did not make any difference.
 
> you'd expect to see roughly VDD/2 average on input and output
With 2.5V supply, signals at SOSCO and SOSCI are in the range approx. from 0 to 1V. SOSCO waveform is a bit distorted. The same picture seen for other PIC24 microcontrollers. Datasheet says: "essential circuits being powered from a separate low-voltage regulator".
 
> there may be an actual issue with that PIC
Agree.
 
Apparenly SOSC circuitry inside PIC has two embedded resistors:
(R1)  a bias resistor between invertor input and output
(R2) resistor in series with output - to minimise power draw and to prevent crystal overdrive. As far as GA70x has "low power" SOSC mode, I guess in that mode R2 value is increased.
 
Both R1 and R2 apparently made as MOSFETs. Thus, their impedance varies from sample to sample and with rail voltage. My rail voltage of 2.5V is quite low. If internal low-voltage regulator is not good enough  then internal SOSC rail might be a bit low too. It may make R1 and R2 resistance a bit too high. Probably this is the reason why SOSC "low power" mode does not work well in my case, R2 already is high because of low rail voltage.
 
Most devices operates as expected, but some do not have enough bias, R1 value is too high. In that case 5.1M resistor across crystal helps.
 
Other might have R2 value too high. In that case a resistor across crystal is harmful, while reducing SOSCO capacitor from 22pF to 10pF helps.
#15
dan1138
Super Member
  • Total Posts : 4324
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/02 18:41:33 (permalink)
0
There is another thing you can try.
 
I know you have a lot of history using the MS3V-T1R-32.768kHz-12.5pF-20PPM-TA-QC crystal.
 
The Micro Crystal data sheet specifies the "Series resistance" (also called motion resistance or ESR) as 50K to 60K ohms.
 
There are other 32.768KHz crystals with somewhat lower series resistance. With a lower series resistance the crystal will start faster and sustain oscillation at lower VDD voltages. Also crystals with lower load capacitance 9pf or 6pf may also work better in your circuit.
 
The goal here is to get the crystal to sustain oscillation with the least amount power required from the oscillation amplifier. The gain margin of these oscillation amplifiers is usually very low and declines when ambient temperature increases.
post edited by dan1138 - 2021/02/02 18:46:42
#16
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/03 17:06:13 (permalink)
0
> With a lower series resistance the crystal will start faster and sustain oscillation at lower VDD voltages.
 
AN1798 reads:
 
"When using a crystal with a low-ESR, less than 50 kOhm, the oscillator does not need much energy to drive, which in turn, makes the self-biasing comparator unstable. This results in the comparator producing a 32 kHz digital clock with the duty cycle not being 50%. Variation in the duty cycle is a direct representation of oscillator performance and accuracy.
 
The desired ESR rating of 50K typical (70K max) will provide an optimum performance across temperature
and voltage"
#17
a_kouz
Starting Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/12/18 19:07:23
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/07 17:56:58 (permalink)
0
rpg7
I have had some luck when making the SOSCO cap larger than the SOSCI cap. Try SOSCO 22pF and SOSCI 10pF

Today I've met a board failing both tests (a) and (b) with 22pF at SOSCI and SOSCO.
 
I've changed SOSCI cap  to 10pF. It helps, both tests passed, thank you. However, when I touched SOSCI pin with 1:10 oscilloscope probe, signal amplitude significantly increased whithin about half second. "Significantly" means about 2-3 times. It makes me think that 10pF probably is not enough.
 
Then I've replaced SOSCI cap by 15pF, and now SOSCI signal is much more stable. Oscilloscope probe changes it about 20% only.
 
Maybe stray capacitance is too big. I use 4-layer PCB, prepreg between top layer and ground plane is only 0.15mm. Capacitors are in case 0603. Distance from SOSCI pin to crystal pad is about 3mm, tracks 0.25mm. Probably I should make a void in the ground plane beneath SOSC tracks and components.
 
PS: After testing 20+ boards, I still unable to find a universal solution
- Approx. half of the boards do not pass test (b). In most cases 5.1M resistor across crystal helps. But there were 2 occasions when with such a resistor boards did not pass test (a) and I had to remove it. 
- Approx. 10% do not pass test (a). It is cured by reducing SOSCI cap to 15pF.
post edited by a_kouz - 2021/02/07 21:54:57
#18
blue_led
New Users
  • Total Posts : 146
  • Reward points : 0
  • Status: online
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/08 02:09:47 (permalink)
3 (1)
Starting from observation of what oscillo probe do to the circuit > add some complex impedance to output, mainly capacitive. As standard is 1 Mohm / 30 pF. This 30 pF make a delay line . I don't know if first gate had schmitt triger behaviour and how linear it is .
I will start with putting 1-4.7-10 Mohm between SOSCI - SOSCO. This can make first gate more sensitive or change DC point to a region more linear. I will insert resistance between SOSCO and capacitor and play with R value and 2 capacitors to the ground.
Starting point for me will be : R1 4.7 Mohm, R2 10.. 50 Kohm. C on SOSCI 15 pF, C after R2 up to 33 pF.
 
One more try will be a resistance from SOSCO to ground starting from 100 Kohm.
 
( ignore example values , they are for higher frequency )

post edited by blue_led - 2021/02/08 02:24:05

Attached Image(s)

#19
oliverb
Super Member
  • Total Posts : 441
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
Re: "Frozen" SOSC in PIC24FJ128GA705 2021/02/08 04:56:18 (permalink)
0
Oscilloscope probe loading is a real problem, I've seen mention of FET input probes which can help but my understanding is that they are expensive and delicate. I'd be tempted to try improvising something, such as a fast buffer driving a terminated 50 or 75 ohm cable.
 
I believe the PIC has CLBs, meaning that temporarily a CLB could be used to route the logic signal to an I/O pin, giving a way to measure the square wave non-intrusively. Unfortunately that doesn't get you the analogue waveform but you can look at square wave duty and jitter.
 
I may be wrong but I would expect the first gate of the oscillator to be a weak non-schmitt inverter, since it is meant to be biased into its linear region. A simple way of getting ultra-low current operation is to "starve" the gate by reducing its supply voltage, though this typically means the following gate needs to be a level-shifter.
 
If I understood the advice then a way to margin-test an oscillator was to put a test resistance in series with the crystal, between the capacitors. This was to simulate the effect of a higher ESR crystal in order to weed out designs where there just wasn't enough gain in the circuit to work reliably with every crystal.
 
I wonder if it is worth trying to measure the gain of the oscillator gate on the two PIC parts directly?
 
Sadly the HA7210 is long discontinued but its datasheet is still quite informative regarding low power oscillators.
 
 
 
#20
Page: 123 > Showing page 1 of 3
Jump to:
© 2021 APG vNext Commercial Version 4.5