32.768KHz does it need bypass caps and what value? - Page 1
Forum section: electronics / projects

author: jwhitmore
author_rank: Regular Contributor
timestamp: September 14, 2016, 08:24:04 pm
content: Hello all, I'm trying to add a 32.768KHz crystal to a PIC processor's secondary clock connectors, for the RTC in the PIC. I'm already using a 16MHz Crystal for the primary clock which has two identical Bypass Caps between each side of the crystal to Ground. The two Caps on the 16MHz are 22pF to ground and think I got that value from a datasheet from Microchip, or from the actual datasheet of the crystal.Now I'm looking at the 32.768KHz and the datasheet  doesn't mention anything about those Bypass Caps. Can anybody point me in the direction of how you calculate the value of Caps required for a crystal, or are they even needed and if not how do you know? I've been trying a bit of google and got this paragraph which didn't help much:> Bypass capacitor capacity value:> The standard bypass capacitance values are between 0.01?F and 1?F. This value should be set> as low as possible but within a range where the power terminal VCC and power line impedance in> relation to the ground is a frequency that is three times the frequency of the crystal oscillator. Here, you> must confirm the frequency properties at this capacity to ensure that impedance levels on the> high-frequency side or low-band side do not increase.I know that paragraph is English, I recognise all the words but it kinda went over my head.http://www.farnell.com/datasheets/1881560.pdf

author: Pjotr
author_rank: Frequent Contributor
timestamp: September 14, 2016, 08:58:07 pm
content: It's not difficult. For the crystal a "load capacitance" is always specified. That is the external capacitance the crystal "sees" between its terminals. The data sheet says 12.5pf for this crystal. That means the total series value of both load C's must be 12.5pf. Usually the load C's are chosen equal for a MCU internal Pierce oscillator. This means each C will be 25pF for a total load C of 12.5pf. However that value is the combined capacitance of the C + PCB trace + pin capacitance of the MCU. So the real value will be smaller. Sometimes this C's are incorporated into the MCU for the RTC and no extra C's are needed. Look at the data sheet.

author: jwhitmore
author_rank: Regular Contributor
timestamp: September 14, 2016, 09:28:11 pm
content: Thank you that is certainly clearer to me. Unfortunately the Microchip's Datasheet does not specifically mention anything about those Caps, concentrating on programming of the registers. I'll try with the 25pF and if it works I'll go with that.thanks again

author: JPortici
author_rank: Super Contributor
timestamp: September 14, 2016, 09:31:46 pm
content: which pic? have you checked the electrical charcteristics/ reference manual of rtc module?

author: jwhitmore
author_rank: Regular Contributor
timestamp: September 14, 2016, 09:57:29 pm
content: I'm using a dsPIC33EP256MU806 is chip datasheet is RTC for family of processors is Oscillator for the family Section 7-8 is the secondary oscillator but don't mention electrical charisticsI've got table 32.15 on page 511 in  but it only mentions the primary oscillator pin, SOSCO pin isn't giving me much. It might be hidden in there somewhere but even searching the document ain't helping me.http://ww1.microchip.com/downloads/en/DeviceDoc/70616g.pdfhttp://ww1.microchip.com/downloads/en/DeviceDoc/S29.pdfhttp://ww1.microchip.com/downloads/en/DeviceDoc/70580C.pdf

author: JPortici
author_rank: Super Contributor
timestamp: September 15, 2016, 07:20:27 am
content: Alright, in the datasheet you find the answer in figure 2-3 Suggested placement for oscillators. the caps are drawnalso there is no mention anywhere of internal loading caps and how to tweak them so there you goActually i suggest that for your prototype (or production unless you are very brave) you use this circuit in figure (a)https://www.maximintegrated.com/en/images/appnotes/2154/2154Fig01.gifbest case scenario the series resistor is a 0 ohm, the parallel resistor is unpopulated (the inverter is actually inside the MCU

author: Ian.M
author_rank: Super Contributor
timestamp: September 15, 2016, 07:42:57 am
content: The MCU manufacture *CAN*NOT* tell you what caps to use for the Pierce oscillator for the crystal because they have to be matched to the crystal. so you need the crystal manufacturer's datasheet. They can make suggestions for 'ballpark' values to get you started, but the wrong value caps can 'pull' the crystal off-frequency by a significant amount - errors of the order of ten seconds a day are not unusual.If you don't have the crystal datasheet, find a similar crystal's datasheet and 'suck it and see', with a pair of trimmer caps, and a calibrated precision frequency meter, get it as close as you can to spot on then measure both adjusted values on a capmeter. The one that had the frequency meter probe attached should be measured with the probe sitill across it.

author: Berni
author_rank: Super Contributor
timestamp: September 15, 2016, 09:46:49 am
content: These caps are entirely dependent on the crystal. The datasheet of the crystal will tell you this capacitance value but it includes any PCB trace and MCU pin capacitance too so take a few pF off.All crystals oscillate just fine without these capacitors. The reason is that the capacitance across the crystal pulls its frequency slightly So a 10MHz crystal with too little capacitance might have 10.001MHz and with too much it might be 9.999 MHz. In the case of a 32KHz crystal for a real time clock you might even want a trimm cap there so you can tweak your clock to run spot on.

author: Pjotr
author_rank: Frequent Contributor
timestamp: September 15, 2016, 10:14:36 am
content: Have a look how aPierce gate oscillatorworks. The caps are essential to get 180deg phase shift.

author: dannyf
author_rank: Super Contributor
timestamp: September 15, 2016, 10:23:47 am
content: "sing a 16MHz Crystal for the primary clock which has two identical Bypass Caps between each side of the crystal to Ground."They are load capacitance, specified by the crystal manufacturers.For high frequency crystals or applications where timing isn't that critical, you don't have to have them.For a watch crystal, you generally will need at least one to get the oscillation started reliably.There are 5pf crystals and you may not need anything else other than straight capacitance plus pin capacitance to get them started.

author: Pjotr
author_rank: Frequent Contributor
timestamp: September 15, 2016, 10:47:19 am
content: Quote from: dannyf on September 15, 2016, 10:23:47 amThose crystals are intended for watch use to keep power to the absolute minimum. Be careful, a few pf at 32.768KHz is a very high impedance and the whole oscillator must be treated as such. So keep traces short and avoid induced hum, noise etc.

author: jwhitmore
author_rank: Regular Contributor
timestamp: September 16, 2016, 06:51:55 pm
content: First off thanks a million for all your advice and help. After that, man this is complicated, still if it was easy they'd all be doing it. Thanks again

author: MagicSmoker
author_rank: Super Contributor
timestamp: September 16, 2016, 09:33:26 pm
content: A few other minor practical pointers that might help: 32kHz crystals are a lot more fussy about the load capacitance than those that oscillate in the MHz to low tens of MHz range so have an assortment of pF values on hand - if, for example, the total load capacitance specified in the datasheet is 12.5pF I'll try 22pF (for both caps) first, because it's a standard/preferred value, but have on hand 15pF, 18pF, 24pF and 27pF. Note that this is just to ensure the crystal actually oscillates; additional tweaking might be necessary to ensure it oscillates at the correct frequency (ie - isn't pulled). However, also note that is invariably futile to try to get an RTC in a uC to keep time more accurately than within a second or two per day time if the product - or at least the 32kHz crystal - isn't kept at a stable temperature. Also also note that many 32kHz crystals in those cute little cans only achieve specified accuracy if the temperature is maintained close to 37C (ie - body temperature). That's less of a problem these days now that digital watches have been rendered almost totally obsolete, but buggy whips continued to be sold well after the introduction of the Model T, too...