Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can you "share" clocks between controllers ???

Status
Not open for further replies.

iso9001

New Member
So I have a PIC that is going to be running at 40MHz (prolly PLL), and two CAN controllers that also require clock signals.

The CAN controllers have a OSC1/OSC2 and a CLKOUT. I was wondering is it possible to use 1 10MHz clock for all 3 units or no ?

Is this common/recommended practice ?

Also, I will have to be dealing with some units sleeping while others are awake, don't know if that plays into anything at all,

Thanks!
 
You don't say what PIC you are using. If CLK1 is an input, you can put in an external clock and feed all three from the same source. You could even make one the oscillator and feed CLKOUT to the other two.
 
iso9001 said:
Also, I will have to be dealing with some units sleeping while others are awake, don't know if that plays into anything at all,

Thanks!

It does. If the PIC is driving an Xtal and you put it in Sleep, it usually means disabling the oscillator which may or may not mean a problem for the other devices. I think if the PIC isn't driving the oscillator then it won't have any problem with being fed an external Osc while in Sleep mode. Haven't done it but that's what I recall.
 
I've run three pics on a breadboard, all sharing a 20mHz oscillator ... the oscillator is a Maxim EconoOscillator, in the TO-92 package.

I just daisy-chained the output to all three pic inputs (is that osc1 or 2, i cant recall)

I had to set the config for the pics to work with an single pin external oscillator, their default was to work with a 2-pin crystal.

I don't know if this is a sound method for a commerical design, since I'm sure the clock signal becomes noisy the farther it travels from the source... and the pulses take longer to arrive at the end of the wire than at some point inbetween - not sure that matters at a 'slow' 10 or 20mHz
 
justDIY said:
I've run three pics on a breadboard, all sharing a 20mHz oscillator ... the oscillator is a Maxim EconoOscillator, in the TO-92 package.

Sorry for taking this thread a bit off topic but a TO-92 style oscillator, with trimmable frequency is very attractive.

However, the device datasheet shows that the active current for such device is some 40~50mA and this is easily many more times the PIC operating current of a few mA (2.75mA for 16F628A) using crystal at 20MHz with accuracy timing accuracy. So is the extra current drain justify the use of these oscillators?
 
I guess I'm going to end up driving the pic with its own clock. For the can controllers however I think that 1 clock will surfice.

As far as sleep goes I know that I will have 1 can unit on when the pic is on, the other can chips will be in various sleep/awake states depending on a bunch of factors.

So as long as my most important unit is awake when it needs to be I'll just clock out to the others.

Clocks are pretty cheap so no biggy.
 
eblc1388 said:
justDIY said:
I've run three pics on a breadboard, all sharing a 20mHz oscillator ... the oscillator is a Maxim EconoOscillator, in the TO-92 package.

Sorry for taking this thread a bit off topic but a TO-92 style oscillator, with trimmable frequency is very attractive.

However, the device datasheet shows that the active current for such device is some 40~50mA and this is easily many more times the PIC operating current of a few mA (2.75mA for 16F628A) using crystal at 20MHz with accuracy timing accuracy. So is the extra current drain justify the use of these oscillators?

I agree it is 'wasteful' compared to other low power solutions, probably not something I'd include in any design destined for production - the cost is too high as well, compared to a tuning fork crystal and a few smt caps.

I imagine there are applications where a percision programmable osc (from a 30 khz to 100mhz?!) would come in handy - like on a breadboard. I think these are programmed using the Dallas 1-Wire protocol ... I only have two, I programmed one for 20mhz and one for 10mhz, and seem to have lost the code I wrote to program them, but I don't think it was anything too special.
 
If the microcontrollers accept the same edge-triggering for the clock pin, AND both microcontrollers can run at the frequency you selected, then yes.

The reason why I mention edge-triggering is because I have seen some chips (not microcontrollers) that require a negative edge-trigger applied to the clock pin while others require a positive one.

If one microcontroller accepts positive edge-triggering and the other one negative-edge, then one microcontroller will perform one clock cycle first, then after (1 / frequency of oscillator) seconds, the next microcontroller will perform one clock cycle.

One clock cycle does not necessarily mean an instruction.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top