32Khz crystals don't work on breadboards?

Thread Starter

Fuji

Joined Nov 8, 2014
100
My 32Khz crystal does not work on my breadboard. What are the reasons for this? What about 4Mhz or 10Mhz?

- Is it because of static? Should I get a FR4 as an anti-static?

- Should the crystal be as close as possible to MCU?
 

takao21203

Joined Apr 28, 2012
3,702
maybe you wrecked it. they easily break inside.

try degrease it with lighter fluid but be careful- the backside from breadboards is often glued and that will dissolve from lighter fluid.

There are at least 20 possible reasons.

For instance the legs (pins) are very thin they dont match for breadboard. you need a small carrier, like in the photo.

Indeed you shouldnt bend 32 KHz crystal pins abnormally or sharply or even at all. In old times, the small cylinder was hold in place with a wire bridge.
 

Attachments

#12

Joined Nov 30, 2010
18,224
Just guessing...plug-in breadboards have some capacitance at each connection. I really don't know if it's enough to stop a crystal oscillator.
 

cmartinez

Joined Jan 17, 2007
8,220
My 32Khz crystal does not work on my breadboard. What are the reasons for this? What about 4Mhz or 10Mhz?

- Is it because of static? Should I get a FR4 as an anti-static?

- Should the crystal be as close as possible to MCU?
Do you have the crystal's datasheet, and the way it's connected to your circuit or MCU ?
 

MrChips

Joined Oct 2, 2009
30,712
Yes, crystals can be finicky on breadboards.

When doing a PCB layout you really need to watch how you place your components. Keep the traces as short and straight as possible to the IC pins. Watch out for unintentional inductance and capacitance. Follow the recommendations for the feedback resistor, loading capacitors and series resistor.

If the 32768Hz crystal is to be used for accurate time-keeping you need to use a trim capacitor so that you can trim the oscillation for better precision.
 

Thread Starter

Fuji

Joined Nov 8, 2014
100
maybe you wrecked it. they easily break inside.

try degrease it with lighter fluid but be careful- the backside from breadboards is often glued and that will dissolve from lighter fluid.

There are at least 20 possible reasons.

For instance the legs (pins) are very thin they dont match for breadboard. you need a small carrier, like in the photo.

Indeed you shouldnt bend 32 KHz crystal pins abnormally or sharply or even at all. In old times, the small cylinder was hold in place with a wire bridge.
Thanks for the reply. Makes sense.

I was wondering if there is a component that can hold the crystal in place. Like a screw type carrier component I can add to the copper trace (2 of them) that can hold the thin legs of the crystal within them?
 

Thread Starter

Fuji

Joined Nov 8, 2014
100
Yes, crystals can be finicky on breadboards.

When doing a PCB layout you really need to watch how you place your components. Keep the traces as short and straight as possible to the IC pins. Watch out for unintentional inductance and capacitance. Follow the recommendations for the feedback resistor, loading capacitors and series resistor.

If the 32768Hz crystal is to be used for accurate time-keeping you need to use a trim capacitor so that you can trim the oscillation for better precision.
I noticed when I try to see pulses from the LED connected to the microchip, the pulses I barely see. the LED just blinks a few seconds (oscillates) and then its fully on for a long time. Would this be the cause of the crystal and breadboard together not making the pulses work properly?

Also, since you brought up unintentional inductance and capacitance, is it possible to add a ground shield to the crystal? Would this help insulate the crystal from surrounding components?
 

Thread Starter

Fuji

Joined Nov 8, 2014
100
Do you have the crystal's datasheet, and the way it's connected to your circuit or MCU ?
I ordered the crystal cylinder 32.678Khz with two thin pins. The info didn't come with a datasheet but Im sure you know the cylinder crystal. Pretty small.

Do you know a component I can add to the breadboard that can hold those thin pins? I remember I saw a youtube video where someone had two screw like components with holes within them that can hold the crystal pins inside, I don't know what the name of that component is.
 

cmartinez

Joined Jan 17, 2007
8,220
I ordered the crystal cylinder 32.678Khz with two thin pins. The info didn't come with a datasheet but Im sure you know the cylinder crystal. Pretty small.

Do you know a component I can add to the breadboard that can hold those thin pins? I remember I saw a youtube video where someone had two screw like components with holes within them that can hold the crystal pins inside, I don't know what the name of that component is.
Are you using the crystal to oscillate an MCU, and if so, how exactly did you connect it?
 

MrChips

Joined Oct 2, 2009
30,712
I noticed when I try to see pulses from the LED connected to the microchip, the pulses I barely see. the LED just blinks a few seconds (oscillates) and then its fully on for a long time. Would this be the cause of the crystal and breadboard together not making the pulses work properly?
You need to clarify where are you connecting the LED?
What microchip are you using?
Where is the complete circuit diagram?
What are the component values? (I just noticed the capacitors are 15pF.)
What is the recommended feedback resistor that goes in parallel with the crystal?
Is the crystal series or parallel resonant?

Also, since you brought up unintentional inductance and capacitance, is it possible to add a ground shield to the crystal? Would this help insulate the crystal from surrounding components?
Yes, with sensitive pins there is such a PCB layout technique using what is known as a guard ring.
But before you get into that you need to answer the questions stated above.
 

cmartinez

Joined Jan 17, 2007
8,220
This is how it is connected, showed in the picture. Capacitors are 15pF.
I consider myself an expert in the 8051 architecture. A few years ago I had the same issue as you, until I took into account four simple facts that helped me solve the problem:
  1. Crystals have a series equivalent resistance
  2. Crystals have an internal capacitance
  3. Most MCU's have a maximum allowed capacitive load at their oscillator inputs (which must include the crystal's inherent capacitance), if you exceed it then their internal oscillator won't work. If the value is too low, then the oscillator might not start. Check the MCU's datasheet.
  4. Some MCU's require that you select (through an internal setup bit, which is set or cleared at the moment of programming) if they're going to run using their own internal oscillator (which is connected to the external crystal and caps) or if you're going to run them through an external oscillator. That is, if you're going to use just the crystal and caps, or if you're going to clock them with a perfect TTL square wave being generated by an external oscillator. This option is normally found in the device programmer that you're using.
This last issue gave me quite quite a headache a few years back, until I discovered that the default setting of my programmer was the use of an external oscillator... that's why my crystal and caps weren't working at first.
I suggest you double check on the points I just mentioned before you go any further

EDIT: In my case, I like to use Atmel's 89LP4052 MCU, which won't accept a total capacitive load at its oscillator inputs of more than 20pf ... in your case, you're using 30pf plus your crystal's capacitive load ... but you haven't mentioned which specific MCU you're using
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,220
One last thing.... some oscillators (though I doubt this is the case) require a voltage ramp-up at start up for them to work. If you apply power all of a sudden to the circuit, they might fail to start oscillating. This is normally fixed by adding a large value capacitor (say 4.7 µf) between the V++ pin of your MCU and ground, as close to the MCU as possible.
 

ErnieM

Joined Apr 24, 2011
8,377
I have used a 32 Khz crystal on a breadboard with no problems.
Same here. I don't use solderless breadboards, I keep the leads short and as close to the chip as I can get them.

I did not check accuracy which I assume is horrible (ie, a few percentage ponts or some seconds per day) in what is basically an uncontrolled situation. When I want it accurate I buy a self contained oscillator with the crystal inside and a calibration spec on the outside.
 

ian field

Joined Oct 27, 2012
6,536
Just guessing...plug-in breadboards have some capacitance at each connection. I really don't know if it's enough to stop a crystal oscillator.
If its a tiny watch crystal - those tiny little leads won't touch the sides in a breadboard.

Maybe make up a patchboard of just 2 holes of Veroboard with a couple of lengths of 18 or 20SWG tinned copper wire, the crystal can be tacked onto the solder joints on the patchboard.
 

Thread Starter

Fuji

Joined Nov 8, 2014
100
I consider myself an expert in the 8051 architecture. A few years ago I had the same issue as you, until I took into account four simple facts that helped me solve the problem:
  1. Crystals have a series equivalent resistance
  2. Crystals have an internal capacitance
  3. Most MCU's have a maximum allowed capacitive load at their oscillator inputs (which must include the crystal's inherent capacitance), if you exceed it then their internal oscillator won't work. If the value is too low, then the oscillator might not start. Check the MCU's datasheet.
  4. Some MCU's require that you select (through an internal setup bit, which is set or cleared at the moment of programming) if they're going to run using their own internal oscillator (which is connected to the external crystal and caps) or if you're going to run them through an external oscillator. That is, if you're going to use just the crystal and caps, or if you're going to clock them with a perfect TTL square wave being generated by an external oscillator. This option is normally found in the device programmer that you're using.
This last issue gave me quite quite a headache a few years back, until I discovered that the default setting of my programmer was the use of an external oscillator... that's why my crystal and caps weren't working at first.
I suggest you double check on the points I just mentioned before you go any further

EDIT: In my case, I like to use Atmel's 89LP4052 MCU, which won't accept a total capacitive load at its oscillator inputs of more than 20pf ... in your case, you're using 30pf plus your crystal's capacitive load ... but you haven't mentioned which specific MCU you're using
Sorry for not replying to anyone yesterday. I was a little busy.

Im using ATEMGA8-16PU microcontroller.

Thanks for the clarification. Makes sense with everything you said. As for programming, I always make sure that the oscillator is set to LP.

Can the crystal be better used and not damaged in the long run by adding add a resistor from the oscillator going in and an external resistor for the oscillator coming out? Would it be better to use a 'stray' capacitance? Like having a capacitor connected to both pins of the crystal, and then connected to the load capacitors C2 and C3? Kinda reminds me of that pierce oscillator design.

As you mentioned in point 3, I need the right values. Would a higher value of pF be preferable for a 32.678Khz crystal in any case as default load capacitance? I was told a maximum of 22pF is enough. Some others say its between 2 - 22pF, but as you said in point 3 I think it depends.
 
Last edited:

Thread Starter

Fuji

Joined Nov 8, 2014
100
If its a tiny watch crystal - those tiny little leads won't touch the sides in a breadboard.

Maybe make up a patchboard of just 2 holes of Veroboard with a couple of lengths of 18 or 20SWG tinned copper wire, the crystal can be tacked onto the solder joints on the patchboard.
Have you seen a component that can be soldered onto the PCB board track that is like a crystal carrier? I remember seeing someone on youtube that used two screw-like components with holes in them to hold the crystal pins tightly.
 

cmartinez

Joined Jan 17, 2007
8,220
Im using ATEMGA8-16PU microcontroller.
Would a higher value of pF be preferable for a 32.678Khz crystal in any case as default load capacitance? I was told a maximum of 22pF is enough. Some others say its between 2 - 22pF, but as you said in point 3 I think it depends.
In the the following file:


Check for these facts:
  • In page 26, Table 2, it's shown that you have to set CKSEL3..0 as 0100 - 0001 in order to use the internal oscillator
  • In page 27, Table 4, it's clearly shown that you must set CKOPT as 0 (and set CKSEL3..1 in an allowable range, accodingly), in order to work with frequencies lower than 1 Mhz

AND, in page 28, it tells you exactly how to use a 32.768kHz crystal:

"To use a 32.768kHz watch crystal as the clock source for the device, the Low-frequency Crystal Oscillator must be selected by setting the CKSEL Fuses to “1001”. The crystal should be connected as shown in Figure 11 on page 27. By programming the CKOPT Fuse, the user can enable internal capacitors on XTAL1 and XTAL2, thereby removing the need for external capacitors. The internal capacitors have a nominal value of 36pF"
 
Top