Pages: [1]   Go Down
Author Topic: Atmega 328 crystal location.  (Read 718 times)
0 Members and 1 Guest are viewing this topic.
2nd star on the right
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Everything I am is classified under the official secreats act!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm designing very slim pcb for use with the TLC5940 (20mm wide), so far I've been working on the plan for a single layer pcb but i came across a question.

Wheres is the best place to put the crystal and route the connections?
I have 2 versions with the crystal mounted on the end.
V1 runs the crystal lines around the outside of connections from the end to the XTAL pins.
V2 runs the Crystal lines underneath the mega to the XTAL pins.

Is there a problem with interference from the crystals lines being run around the outside?
(see the attached image for the v1 pcb.


* Dominatorpcb1.jpg (191.34 KB, 1167x429 - viewed 31 times.)
Logged

Sorry for the noobish post but my knowledge is 10 years out of date!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Best crystal location is right next to the pins with short traces.  See attached.

Can you mount the crstal and caps on the bottom of the board to make the traces shorter? Solder them in first, trim the leads, then install the uC.

* Atmel AVR042 AVR Hardware Design Considerations.pdf (236.19 KB - downloaded 8 times.)
« Last Edit: March 31, 2013, 07:05:12 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Unless you need accurate timing, a 3-terminal ceramic resonator will take up much less room than a crystal + caps
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are Resonators available as thru hole parts?

http://www.digikey.com/product-detail/en/CSTLS16M0X55-B0/490-1214-ND/584422
I guess so.

http://www.dipmicro.com/store/XC7-16000
http://www.dipmicro.com/store/C1K22-50

Or even less:
http://www.taydaelectronics.com/16-000-mhz-16-mhz-crystal-hc-49-s-low-profile.html
http://www.taydaelectronics.com/capacitors/ceramic-disc-capacitors/10-x-22pf-50v-ceramic-disc-capacitor-pkg-of-10.html
12 cents for both.

Little more space worth the tradeoff to me for accurate timing.
With a crystal, can write a time sketch that's good for a second a day drift.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 2
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hallo

I see from your picture that you are constrained for space and have a limited option on where to place the crystal. The rule is to position the crystal as close as possible to the prescribed pins.

The worst case scenario's are as follows:

Long track lines can become electromagnetic (EM) radiators which could fail your design if it were to go for Radiated Emission Tests at a certified test lab.

Another aspect to consider is electromagnetic (EM) susceptibility. Long tracks can act as receiving antennas i.e. imagine the design is implemented in a vechicle where Electromagnetic spikes from the spark plugs are a threat to your design. In this instance, a random spike could cause a glitch in the clock.

If possible, one could lay the circuit out on a 4 layer PCB such that the track lines are enclosed between two ground planes:
e.g.
Layer 1 [top]
Layer 2 [gnd plane]
layer 3 [tracks from crystal to IC pins]
Layer 4 [gnd plane]

The gnd planes would act as an electromagnetic shield that would curtail electromagnetic emissions  and  as well as prevent the lines from being susceptable to electromagnetic interference
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

4 layer? Really?
Just put the crystal under the board, let its "flanges" overlap the items above without interfering.

Or, go surface mount with a few parts, put the uC in a socket and put the crystal, caps, reset pullup resistor/diode/DTR cap underneath it. Put the VCC/AVCC/AREF caps under the chip too.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

2nd star on the right
Offline Offline
Full Member
***
Karma: 0
Posts: 103
Everything I am is classified under the official secreats act!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks DigitalRS and Cross roads.
I was still working in single layer format!
I think I will go duel layer and add it under the mega chip.

Thanks for the interference info, that was what I was looking for.
Logged

Sorry for the noobish post but my knowledge is 10 years out of date!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Even single layer, you can put the parts under the uC chip.


* DIP_single_sided1.png (52.21 KB, 869x458 - viewed 24 times.)
« Last Edit: April 01, 2013, 06:56:21 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: