Atmega328P 32.768KHz Crystal Issue

Everything ARM and LPC

Moderator: phalanx

Post Reply
yamadanao
Posts: 2
Joined: Tue Jun 20, 2017 2:52 am

Atmega328P 32.768KHz Crystal Issue

Post by yamadanao » Tue Jun 20, 2017 2:57 am

I am having an issue with 32.768khz crystal connected to an Atmega328P (which I am using as an external source to timer2 in asynchronous mode to wake up the Atmega from sleep every second).

This is the date sheet of atmega328p

On a breadboard everything works fine and as expected.

However upon assembling the circuit on a PCB, the AVR never comes out of sleep. For some reason the crystal is not oscillating

Can someone explain what is the right way to design the PCB as far the crystal is concerned to ensure correct operation (including selecting the capacitors). I have read about it here n there but never given much thought to it.

To remidy the issue, I tried the following but none of them worked:

Tried multiple crystals
Soldered the crystal directly to Atmega328P TOSC1/2 pins
Added 22pf/10pf caps connecting the crystal pins to GND

Here's a close up picture of the crystal attached to the PCB. I had to add some jumper wires because I broke off the traces trying out multiple crystals.

jremington
Support Volunteer
Posts: 2105
Joined: Fri Jun 15, 2007 9:41 pm
Location: Eugene, Or

Re: Atmega328P 32.768KHz Crystal Issue

Post by jremington » Tue Jun 20, 2017 8:17 am

The crystal capacitors may need to be higher. Try 2x30 pF.

Be sure that you have selected "low power oscillator" in the clock fuse setting while programming.

mozobata
Posts: 3
Joined: Wed Jul 19, 2017 1:32 am

Re: Atmega328P 32.768KHz Crystal Issue

Post by mozobata » Thu Jul 20, 2017 3:10 am

jremington wrote:The crystal capacitors may need to be higher. Try 2x30 pF.

Be sure that you have selected "low power oscillator" in the clock fuse setting while programming.
Thank you!

Post Reply