CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

is it possible to use a XTAL for driving two or more PICs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ferkar



Joined: 14 Jul 2007
Posts: 38

View user's profile Send private message

is it possible to use a XTAL for driving two or more PICs
PostPosted: Tue Feb 24, 2009 3:00 am     Reply with quote

i was wondering if it is possible to use a xtal for driving two more Pic

any idea?
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Tue Feb 24, 2009 3:20 am     Reply with quote

Yes

Drive from OSC out to OSC in ...

Good Luck
Ttelmah
Guest







PostPosted: Tue Feb 24, 2009 3:30 am     Reply with quote

Yes, _but_.

Chips must be close together.
For accurate timing, you need to factor the extra parasitic capacitance into the calculation of the loading capacitors.
Microchip do have an application note covering doing this.

Generally, simpler, and more reliable (and probably gives you extra I/O pins as well), to use an external crystal module, which will typically have a fan-out of five or more nomal loads, Costs of these now, are so low, that it is the 'better' solution for most situations.

Best Wishes
magestik



Joined: 16 Oct 2008
Posts: 59

View user's profile Send private message

PostPosted: Tue Feb 24, 2009 6:17 am     Reply with quote

I was asking myself the very same question, very interesting Cool.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Feb 24, 2009 8:47 am     Reply with quote

Actually the second PIC only adds capacitance to the OSCOUT pin of the first PIC. It really doesn't have any effect on the crystal. You should not have to adjust the loading cap values at all for adding a second or third PIC driven from the OSCOUT of the the first PIC.
All the PICs should be very close by and share a common ground and VCC level. If you have many PICs (I have 10 in one application) add a good CMOS buffer from the OSCOUT of the master PIC to the OSCIN pins of the slaves.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah
Guest







PostPosted: Tue Feb 24, 2009 9:16 am     Reply with quote

Not quite.
The capacitance on the OSCOUT pin, is still seen as part of the load the crystal actually has 'across' it.
It is the series-parallel combination of the two capacitors to ground, _paralleled_ with the parasitics at each pin, _in series_, that gives the Cload, seen by the crystal. If the load at Cout, didn't matter, you would not even bother to put a capacitor on this pin. It does, and you do.
You do need to factor the extra capacitance of the pin, and the track to it, into your calculation, to get accurate frequencies. The common 'trick', is to take Cload (say 16pF), and then calculate the total capacitance to use at each end, as this *2 (since these capacitors are in series), to give a required capacitance of 32pF, then subtract the pin capacitances, taking perhaps 5pF for each pin, giving 27pF to use at the OSCIN pin, and perhaps 18 to 22pF at the connection to the two OSCOUT pins (allowing for 2*5pF, plus the track capacitance).

The capacitance is not a load on the pins, but a load _across_ the crystal, and both ends matter in calculating this.

Best Wishes
ferkar



Joined: 14 Jul 2007
Posts: 38

View user's profile Send private message

xtall
PostPosted: Tue Feb 24, 2009 9:59 am     Reply with quote

I have two 16f877 in my project.

One is responsible for driving a special motor SRM while the other one shows the set and feedback values by using LCD. The latter one has also an adding functions that is sending the datas to the pc.

PICs and motor are driving by same transformer.

During my test I realized that the PICs are suffering from xtal .
Then I decided to use two different xtals, one for each.

The problem still exists. They never works properly. Sometimes one is running sometimes the other.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Feb 24, 2009 10:07 am     Reply with quote

I use oscillator cans. In one design I run four PICS off of one oscillator.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: is it possible to use a XTAL for driving two or more PIC
PostPosted: Wed Feb 25, 2009 12:25 am     Reply with quote

ferkar wrote:
i was wondering if it is possible to use a xtal for driving two more Pic

any idea?


Yes. I have hundreds of devices in the field in this configuration.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Jim Hearne



Joined: 22 Dec 2003
Posts: 109
Location: West Sussex, UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Feb 26, 2009 4:05 am     Reply with quote

We've used the clockout from a pic running on it's internal oscilator to provide a clock signal for an ASIC
Save adding a crystal to a pcb only 10.5mm wide, very handy.

Jim
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Fri Feb 27, 2009 10:32 pm     Reply with quote

How would you actually wire the two PICs to the crystal? i.e. are the two PICs OSC1/OSC2 pins wired in parallel?

PICoHolic suggested OSC out to OSC in - does that work by wiring up the first PIC as you normally would, then connecting the OSC2 of the first to the OSC1 of the second, and configuring the second to EC mode (or maybe HS mode, which some PICs seem to allow)?
_________________
Andrew
Ttelmah
Guest







PostPosted: Sat Feb 28, 2009 3:25 am     Reply with quote

There are three separate configurations being talked about here now.
#1 Two PICs one crystal.
With the caveat about allowing for the extra capacitance, and keeping the tracks short, the wiring for this, is to wire PIC#1, 'as normal' for a crystal, and connect it's 'clkout' pin to PIC#2's CLKIN. On PIC#1 select the normal crystal fuses (XT, HS, or HSPLL). For PIC#2, you can gain a pin, by selecting EC_IO, or use the same crystal setting as for PIC#1 (though there is no connection to this PIC's CLKOUT pin). You have to do this, if you want to use the PLL.
#2 Multiple PICs with an external oscillator. Just connect the oscillator's output, to the CLKIN of each PIC. EC_IO, is probably the 'preferred' option (turns off the oscillator driver in the PIC, so reduces power, and saves a pin). However you can again 'cheat', and use the HSPLL setting, provided the source is below the maximum allowed oscillator frequency for the PIC. On early 18 PICs this can give problems, with the PLL not locking correctly, if the input signal is too large. A series resistor solves this.
#3 Using the internal oscillator as an external drive. If INTRC is selected, rather than INTRC_IO, the internal oscillator frequency/4, is present on the CLKOUT pin. This can be a useful oscillator for other items on the board, and can be treated as a normal general purpose CMOS oscillator output.

Best Wishes
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Sat Feb 28, 2009 10:53 pm     Reply with quote

Thank you. That's cleared up all my questions!
_________________
Andrew
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group