PDA

View Full Version : Multiple PIC's with 1 crystal



puma
- 18th July 2004, 20:37
I was wondering if it is possible to connect multiple pic to 1 crystal ossilator. It would save some space on the pcb and some components if you were using more than one PIC on an pcb.

If it is possible to connect multiple PIC's on to 1 crystal ossilator. How do you connect them?

Thanks

Squibcakes
- 19th July 2004, 07:08
Puma,

What type of PIC chips are you using.. maybe they have an on board oscillator that you can use instead?

Some PICs allow you to use the external clock input for single oscillator pcbs.

Cheers

Melanie
- 19th July 2004, 09:39
Method 1.

Connect OSC2 from the PIC with the Crystal, to OSC1 of the PIC's without. Disadvantage: If you are driving more than about 2 or three slave PICs, you will need a simple CMOS or TTL driver/buffer as it will load the Master's oscillator too much. You have to set the Master for HC Oscillator (even at clock rates of 4MHz or under) to provide extra drive on the Oscillator if you have more than one slave PIC. I have many thousands of a design in the field with one master and two slaves without any problems whatsoever using this method.


Method 2.

Connect OSC2 from the PIC1 with the Crystal, to OSC1 of PIC2 without. PIC2's OSC2 connects to PIC3's OSC1. PIC3's OSC2 connects to PIC4's OSC1... ad infinitum... Disadvantage: If one of the PICs failed, all the PICs down the chain from that PIC will cease operating also.


You can use any combination of Method 1 and Method 2 to construct Oscillator arrays as big as you wish.


Method 3.

Use a CMOS HEX Inverter/Driver IC and build a simple conventional Oscillator (as you would do if you were building a standard non-PIC logic design. Fan this out to heaps of PICs on your PCB as each HEX inverter/buffer stage should be able to fan-out to over a dozen PICs.


Method 4.

Use a ready-built 'canned' Oscillator... careful though, some of those TTL ones generate heaps of RFI...

puma
- 19th July 2004, 21:44
Thanks melanie for the explanation. It help me verry much. If have some projects in my mind where I could use this knowhow. For example:
If have a master PIC wich sends datastream to several slave PIC's (8 or so) they filter and use the data to do something with it. When they share/use the same oscillator stream I could get the slave PIC's to do there task at exactly the same time (when al other slave PIC are ready to)

Again thanks.

rossfree
- 5th September 2006, 15:39
Melanie,

I would like to share the crystal of a 16f876 with a 12f675. By your description, I tie osc2 from the 876 to osc1 of the 675. What about osc2 of the 675. Do I leave it hanging or tie it to something?


Thank you,

Ross

RussMartin
- 6th September 2006, 07:13
Method 3.

Use a CMOS HEX Inverter/Driver IC and build a simple conventional Oscillator (as you would do if you were building a standard non-PIC logic design. Fan this out to heaps of PICs on your PCB as each HEX inverter/buffer stage should be able to fan-out to over a dozen PICs.

My experience with these (both CMOS and TTL) is that, like Method 4, they can generate some interesting RFI, especially on the odd harmonics.

(I mean "interesting" in the sense of the ancient Chinese curse, "May you live in interesting times.")

rossfree
- 18th March 2007, 20:03
I never got an answer to this question.

I would like to share the crystal of a 16f876 with a 16f88. By the thread above, I tie osc2 from the 16f876 to osc1 on the 16f88. What about the second osc2 input on the 16f88. Do I leave that pin hanging or tie it to something?


Thank you,

Ross

skimask
- 18th March 2007, 22:39
I never got an answer to this question.

I would like to share the crystal of a 16f876 with a 16f88. By the thread above, I tie osc2 from the 16f876 to osc1 on the 16f88. What about the second osc2 input on the 16f88. Do I leave that pin hanging or tie it to something?


Thank you,

Ross

For one thing, OSC2 is usually Fosc/4 (i.e. 10mhz in = 2.5mhz out), so depending on how you have it set up, the one PIC will run 1/4 the speed of the other PIC. In any case, you try it with it hanging; it doesn't work, try a weak pull up, that doesn't work, try a weak pull up, etc. and so on and so on...

If it was me (and I've done this before), I'd get yourself one of those 4 pin oscillators, run the clock output of that into something like a 7404, tie a couple of the inputs together, and use the individual outputs to drive the seperate clocks of the PICs, which are set to external clock or HS mode. Simply put, the 7404 is used as a buffer to keep the 2 inputs from messing with each other.
Or, use a 7404 as part of a crystal oscillator circuit and take the output and run it into a couple of other inputs as suggested above.

Dave
- 19th March 2007, 12:19
rossfree, Don't listen to skimask as the OSC2 output is divided by 4 ONLY in RC mode and INTIO mode. Either of which you are using. In normal HS or XT modes the OSC1 signal is buffered and inverted on OSC2. It's all in the data sheets....

Dave Purola,
N8NTA

skimask
- 20th March 2007, 15:02
rossfree, Don't listen to skimask as the OSC2 output is divided by 4 ONLY in RC mode and INTIO mode. Either of which you are using. In normal HS or XT modes the OSC1 signal is buffered and inverted on OSC2. It's all in the data sheets....

Dave Purola,
N8NTA

Right, don't listen to me...sometimes I don't know what I'm talking about....like in the above post :)

rossfree
- 20th March 2007, 17:56
Thank you... I was a bit puzzled...

Which brings me back to the original question...

Do I tie off osc2 on the second PIC or leave it unattached??? Looking for a simple answer. :-)

Ross

Melanie
- 20th March 2007, 18:02
Just leave it hanging (or use it as an available I/O if your particular PIC permits). If you needed to do something with it, I would have said so in my original post at the start of this thread.