sharing crystal

I use another IC (an MCP2515) that need a 16MHz crystal too. For the moment I am using a prototype board with the chip and the crystal, and it interfaces via SPI to a Freeduino having his own 16MHz crystal.

However when I move to a all-in-one solution on a unique PCB, can I share the crystal between the 168P and the MCP2515?

It is not that simple. You can't share the crystal this way. You should buffer the first oscillator to drive the second circuit. The buffer will use an equivalent surface on your board as the crystal. So there is no real benefit except that the 2 circuits will be synchronous. Is it necessary?

It is possible to share the crystals by wiring one up normally and taking a lead from one side directly into the other processor.
However, in order for this to work you have to set the fuse links CKSEL in the slave processor to indicate it is using an external oscillator. As this is part of the micro that is not touched (or touchable) by the boot loader you will have to programme that Arduino directly.

A crystal oscilator (something like this) would probably be more appropriate for this application, but fuses will need to be changed.

Crystals are cheap, clock routing can be problematic, not all devices are made to share crystals. Unless I planned mass production, I'd just use two crystals.

-j

Ok thanks, I will use 2 crystals and then 4 capacitors, I don't care for the price of it :slight_smile: