View previous topic :: View next topic |
Author |
Message |
iso9001
Joined: 02 Dec 2003 Posts: 262
|
OSC / PLL Question |
Posted: Thu Jun 15, 2006 2:26 pm |
|
|
Hi,
I'm trying to save some money and board space in a circuit I'm working on. PIC18F with a 2515 SPI CAN controller one it. They both need a 10Mhz oscilator and I was trying to figure out how to make them both share 1 crystal but didn't know if have the H4 fuse on the PIC set would screw anything up for the 2515.
I didn't know if this would be a good cicuit or not:
Or if its commonly done without the transistor.
Is this OK if the cap2 is slightly lower then cap1 ?
Anyone have any ideas ? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 15, 2006 3:56 pm |
|
|
Another option is to use the CLKOUT pin on the MCP2515 and use
it to drive the OSC1/CLKI pin on the 18F452. I tested this with
a 4.0 MHz oscillator (in the metal "can" package), and it worked.
The 18F452 used the H4 fuse. Unfortunately, I can't find any
statement in the 18F452 data sheet or reference manual that
says it's OK to do this. All they talk about is using a crystal with
the PLL. They don't say if you can use an external oscillator or
other clock source instead of a crystal. Until I saw some sentence
saying it's OK, I wouldn't want to do it. |
|
|
iso9001
Joined: 02 Dec 2003 Posts: 262
|
|
Posted: Thu Jun 15, 2006 5:36 pm |
|
|
I like the idea, but I agree that taking chances will PLL is probably going to end poorly for me.
Another problem is that the 2515 will be shut down (unpowered at the VCC by means of a mosfet). So the pimary clock should really be the PIC.
I don't think I'll have problem because one is PLL and the other is normal. Just wanted to see if there is a better way (short of expensive clock oscillators) to do this,
Since I don't have any idea what transistor to use or what its really doing in that first diagram. I'm learning towards the 2nd one. |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
|
Posted: Fri Jun 16, 2006 5:44 am |
|
|
I'm guessing your cost reductions can't "afford" the use of an alternate PIC with internal clock generation? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: OSC / PLL Question |
Posted: Fri Jun 16, 2006 6:23 am |
|
|
iso9001 wrote: | Hi,
I'm trying to save some money and board space in a circuit I'm working on. PIC18F with a 2515 SPI CAN controller one it. They both need a 10Mhz oscilator and I was trying to figure out how to make them both share 1 crystal but didn't know if have the H4 fuse on the PIC set would screw anything up for the 2515.
Is this OK if the cap2 is slightly lower then cap1 ?
Anyone have any ideas ? |
Your second solution will work fine. The PLL is internal and has no impact on the OSC2 output and as such will not impact the 2515. I have used this configuration sharing a crystal between a PIC and an Ethernet controller with the PIC configured with PLL enabled. I also set the cap on OSC2 slightly lower to coompensate for the input capacitance of the downstream controller. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Jun 16, 2006 10:38 am |
|
|
How about just having a clock oscillator feed both of them? Digikey has some small surface mount ones. |
|
|
iso9001+ Guest
|
|
Posted: Sat Jun 17, 2006 3:21 am |
|
|
Didn't want to go with clock oscillators b/c they cost more, and this is the only circuit I have that will need to be shared.
I like to find parts I'm framiliar with and incorperate those into many designs. That way I'm not finding new problems with every single project.
I'm pretty sure every developer does that. hardware or soft |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sat Jun 17, 2006 7:31 am |
|
|
What is your time worth? anything?
I use only 1/2 dip size osc cans and they have always performed flawlessly. They use the about same real estate as an xtal+caps and I know when I use a can it will work first time every time and be accurate. I pay less than $1 for them from surplus houses and Ebay. I pay $1.05-$2.25 from Jameco (many xtals cost a $1 or more plus the caps!). Besides $1.50 is nothing considering the multiple DAYS you have spent so far trying to get it to work! Something to think about.... |
|
|
MGP
Joined: 11 Sep 2003 Posts: 57
|
|
Posted: Wed Jul 12, 2006 4:59 pm |
|
|
Another thing to think about is the power consumption of an oscillator can. Most of the cans I've seen are spec'd at 20 mA of supply current or more. This can be a rude awakening when you realize the oscillator uses much much more power than your MCU! |
|
|
James B Guest
|
|
Posted: Thu Jul 13, 2006 10:10 am |
|
|
I recently had a very similar problem and was pointed to this thread,
Thats exactly right about the clock oscillator, they draw a lot of current. So the only way I found that would be acceptable is to power the pic using the internal osc then power up the clock, switch to the crystal once it stabilizes and then whenever you want to sleep you need to do it all over again.
Kind of a pain, but maybe if you had a regulator with a shutdown it would work better, |
|
|
|