32Khz crystals don't work on breadboards?

Discussion in 'General Electronics Chat' started by Fuji, Dec 15, 2014.

  1. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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?
     
  2. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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.
     
  3. #12

    Expert

    Nov 30, 2010
    16,298
    6,809
    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.
     
  4. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    Do you have the crystal's datasheet, and the way it's connected to your circuit or MCU ?
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    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.
     
    Lundwall_Paul likes this.
  6. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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?
     
  7. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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?
     
  8. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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.
     
  9. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    Are you using the crystal to oscillate an MCU, and if so, how exactly did you connect it?
     
  10. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    This is how it is connected, showed in the picture.

    Capacitors are 15pF.
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    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?

    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.
     
  12. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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: Dec 15, 2014
  13. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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.
     
  14. Brevor

    Active Member

    Apr 9, 2011
    279
    54
    I have used a 32 Khz crystal on a breadboard with no problems.
     
  15. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    Maybe you got lucky.
     
  16. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    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.
     
  17. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    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.
     
    Fuji likes this.
  18. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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: Dec 17, 2014
  19. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    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.
     
  20. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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"
     
    Fuji likes this.
Loading...