Pages: [1]   Go Down
Author Topic: Crystals and 2 chips  (Read 1295 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
Is it possible to run 2 chips off of one crystal? I would like to run two AVR's off of 1 16Mhz crystal. Can they be run in parallel? Do I need to modify the load caps?

Thanks
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Is it possible to run 2 chips off of one crystal?

Directly?  I don't know.

Indirectly?  Yes.  AVR processors can be configured to output the primary clock signal which can be fed to another processor.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't hook the crystal up to two AVR processors at the same time.  What you CAN do is connect the crystal to one AVR and have it output a buffered 16 MHz clock signal that can be used by the other AVR.

You will need custom fuse settings, both for making the first AVR output the system clock on the CLKO (PB0) pin and for making the second AVR use an external system clock on the XTAL1 (PB6) pin.

Another option is to use a 16 MHz oscillator module and feed that to both AVRs as an external clock input on their XTAL1 pins.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
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

You Can hook up 2 chips to one crystal. You have to leave the Xtal2 pin open on the 2nd chip and drive the xtal1 pin from xtal2 of the first chip.
I was trying to do this but couldn't get the fuses right. Eventually decided 2 crystals were easier, both chips could be loaded with standard bootloaders/fuse settings.

9.4 Full Swing Crystal Oscillator
Pins XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can be configured for use
as an On-chip Oscillator, as shown in Figure 9-2 on page 28. Either a quartz crystal or a ceramic resonator may be
used.
This Crystal Oscillator is a full swing oscillator, with rail-to-rail swing on the XTAL2 output. This is useful for driving
other clock inputs and in noisy environments. The current consumption is higher than the ”Low Power Crystal
Oscillator” on page 28. Note that the Full Swing Crystal Oscillator will only operate for VCC = 2.7 - 5.5 volts.


Here's the board I ended up with.  Bare boards available for $5 mailed to your US location.


* dual_328s.jpg (110.3 KB, 829x539 - viewed 57 times.)
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
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The answer is a definitive yes.

Put the crystal on one avr and then route the signal on the crystal output pin to the crystal input pin of the 2nd avr and configure the 2nd avr to use an external oscillator.

You will need to adjust the load capacitance on the 1st avr's output pin a little bit or you will run slightly slower (10 - 20 ppm max).
Logged

Pages: [1]   Go Up
Jump to: