Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sharing a crystal between 2 ICs

Status
Not open for further replies.

Magister

New Member
Hi,

In my project I have two ICs (one AVR ATMEGA and one MCP2515) that communicate via SPI.

They both use a 16MHz crystal so for the moment on my dev board I have 2 crystal and 4 capacitors.

To reduce footprint, can I use the same crystal to drive both chips? Will it cause a problem to share it?

Thanks in advance!
 
You need to know which pins are the input and output for the oscillator circuit, one PIC would have the oscillator components as normal, the other is set to extrernal oscillator, and has it's INPUT pin connected to the OUTPUT pin of the oscillating PIC.

The AVR/MCP would need to have similar facilities.
 
On my MCP there is a CLKOUT pin but it need to be programmed as it, and if my AVR (an ATMEGA168) does not run I can not tell the MCP to output the clock on its pin to drive the AVR. So this solution can not work.

Nigel, in the MCP2515 PDF it's written that OSC1 is input and OSC2 is output, on the AVR it's XTAL1 as input and XTAL2 as output. With only one crystal, how do I have to connect it? Both AVR and MCP are set to use external crystal.
 
You can share the crystal directly if you keep the leads short and the chips close together, you may have to alter your normal capacitor values for the crystal though.
 
Normally this doesn't work. The outputs fight one another, and neither input is at the correct threshold.

We just had a thread similar to this a few weeks ago.
 
Normally this doesn't work. The outputs fight one another, and neither input is at the correct threshold.

We just had a thread similar to this a few weeks ago.
Ah ok, I will look for it, thanks!

Without re-doing the full PCB re-design but with just moving some parts around, the 2 ICs would be about 1 inch apart so the crystal would be in the middle, I guess distance would be ok. Anyway if it's just trouble and not working 100%, and for $1, I can keep both crystals.
 
Hi,


Another solution that might work is the same used with CMOS oscillators.
Some CMOS oscillators use one gate with the crystal around it and and others use two
or more gates in series with the crystal around the entire series connection.
To do this with two IC packages that have internal gates, you would do the
same...connect the two gates in series and put the crystal around the two
gates rather than either one by itself.
I've never actually tried this so i cant guarantee it will work. If it does work,
that's one crystal and two caps and maybe a resistor or two.
 
that's one crystal and two caps and maybe a resistor or two.

Plus the gate.
 
Like Bill said you can set one to external clock. Or use HS mode and just connect the clock signal to the OSC in pin (OSC1), the PIC xtal osc will work fine with a signal connected to the OSC1 pin even in XT and HS modes.
 
Plus the gate.

Well actually if you want to get funny about it that would be
plus two gates. The two gates already exist however inside
the two already existing IC packages, so there is no real
addition of any extra gates.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top