Designing a PCB with ATXmega8E5 + ATmega328p - Crystal ?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm designing a board with an ATXmega8E5 and an ATmega328p. It will have some wireless interfaces and stepper motor controls.

I pretend to use an external capacitor to get best clock accuracy. Reading about it for both I came with the following:

ATXmega8E5:

C1, C2 with recommend value of 10pF for 16MHz.

ATmega328p:

C1, C2 with recommend value of 12pF-22pF for 16MHz.

I also read an atmel note that give the formula to calc capacitance load as:

C = 2*Cl - Cstray where Cs vary from 5pF to 10pF.

Reading more about it on the internet the Cs value should be arounf 5pF.

So in the case of ATXmega8E5 it gives 10 = 2*Cl - 5 <=> Cl = 15/2 =~ 8pF;

For ATmega328p it gives 12 = 2*Cl - 5 <=> Cl =17/2 =~ 9pF;

So am I ok to use the same crystal with CL=8pF for both?

There is anything else that I take a look at?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the parallel capacitance is defined by the crystal you purchase. The crystal specs give you "CL". You estimate the stray capacitance. That determines the external capacitors.

Example:

CL = 11pf
Cexternal = 2*CL = 22pf
But each pin has an estimated 7pf of stray capacitance
So, the physical capacitor would be 22pf - 7pf = 15pf

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
the parallel capacitance is defined by the crystal you purchase. The crystal specs give you "CL". You estimate the stray capacitance. That determines the external capacitors.

Example:

CL = 11pf
Cexternal = 2*CL = 22pf
But each pin has an estimated 7pf of stray capacitance
So, the physical capacitor would be 22pf - 7pf = 15pf

Jim

That is ok on the atmega328p that says you can use an Cexternal between 12 to 22pF but got atxmega8e5 it says you should use a 10pF so we need to calc Cl on function of it, aren't we?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since they are both 16MHz, have you considered using the Mega328's output to feed the XMega and thus save the cost and space for the XMega's crystal and load caps? Or vice versa...

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is simply wrong, unless the pin capacitance is 8pf higher on an XMega. I don't think they are. If anything, XMega pin capacitances are smaller since it is a faster device.

The crystal specs rule over all!

However, the spec sheet MIGHT be telling you to use a crystal with lower load capacitance. I can't tell.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you take a look at page 5 http://www.atmel.com/images/doc8... ? thank you :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:
Since they are both 16MHz, have you considered using the Mega328's output to feed the XMega and thus save the cost and space for the XMega's crystal and load caps? Or vice versa...

That is a good solution even if I want an accuracy clock?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
That is a good solution even if I want an accuracy clock?

Coupling the clocks doesn't effect their accuracy.

The accuracy is determined by the crystal's specs, and by the oscillator circuitry within the micro, (voltage and temperature dependence, etc.).

The output clock signal from the micro with the crystal is a buffered signal, and the "load" of the second micro does not impact the frequency.

This is a good way to eliminate the second crystal, and its caps, from your parts list.

You do, however, want to position the two micros so as to keep the signal trace carrying the clock reasonably short.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I see that and have no argument.

BUT, if you want an ACCURATE clock, you MUST choose a crystal that has a Cload spec that allows such small caps. Again, the capacitors are defined by the crystal. If you want 10pf, then you need to choose a crystal with a load spec of around 9pf. If you don't then it will run at the wrong frequency.

Each crystal is ground, by the manufacturer, to oscillate at the specified frequency with the specified load C. If you build it with a different capacitance, then the frequency will be different from the spec. You have no choice.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all :) Things got clear now :)