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 support@ccsinfo.com

OSC / PLL Question

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



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

OSC / PLL Question
PostPosted: Thu Jun 15, 2006 2:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 15, 2006 3:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 15, 2006 5:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jun 16, 2006 5:44 am     Reply with quote

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: 1634
Location: Perth, Australia

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

Re: OSC / PLL Question
PostPosted: Fri Jun 16, 2006 6:23 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jun 16, 2006 10:38 am     Reply with quote

How about just having a clock oscillator feed both of them? Digikey has some small surface mount ones.
iso9001+
Guest







PostPosted: Sat Jun 17, 2006 3:21 am     Reply with quote

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: 1927
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Jun 17, 2006 7:31 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 12, 2006 4:59 pm     Reply with quote

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







PostPosted: Thu Jul 13, 2006 10:10 am     Reply with quote

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,
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