Someone around here (either Andy or Pete) suggested that I go with a TTL oscillator a while back with my PIC.
While I’m making the conversion from 4620’s to 2620’s (so I can actually fit them on the biped ) I thought it best to make some more improvements, including grabbing a better oscillator.
An oscillator needs +5V and GND and outputs a frequency. Sometimes there is an enable input but generally they have an internal pull-up so you can leave it unconnected.
One of the PIC xtal pins will be the input which is connected to the output of the oscillator. The other pin is unused although some of the newer PICs will let you re-claim the pin as an I/O.
Be aware that most oscillators draw appreciable amounts of current, frequently 15 to 25mA but some of the older TTL oscillators can draw as much as 50mA.
Nick, I think it was me - I remember posting a few weeks ago with the pros/cons of various types of PIC oscillator types.
Eddie is quite right that some of these oscillator “cans” use a lot of power (compared to other stuff you may be using). On that Jameco page, it shows numbers of a few mA, up to 70 mA. Which one are you looking at? Note that the current-drain of the oscillator might still be small compared to the power to run the motors, so maybe you don’t care…
The good news is that a single osc. can be used to run multiple PICs, as long as the wires aren’t too long. But the clock wiring needs to be kept away from any ‘sensitive’ circuits that you might have. Start with a ‘moderate’ frequency, such as 10 Mhz or 16 Mhz. Check with Eddie or myself for advice…
With a 2620 (or similar) PIC, you can use the “ECIO” configuration, and connect pin 8 of the oscillator to the OSC1 pin on the PIC. Then OSC2 (RA6) can be used for something else.
Note that the oscillator only has 4 pins, but they are numbered as if it was a 14-pin DIP IC package. So, pin 8 is the upper-right corner (viewed from the TOP).
The oscillator should have a bypass cap from Vdd to Vss, just like with the PIC and most other digital parts. Most folks use 0.01 uF caps. On a breadboard, it will probably run without the proper bypassing…
Oh, I never really answered your question about how to hook up the oscillator:
Pin 7 to Gnd.
Pin 14 to +5.
Pin 8 to the OSC1 pin on the PIC.
Pin 1 goes nowhere.
OSC2 on the PIC can be used as RA6, for whatever.
Note that the picture in the Jameco catalog is a bottom view.
I have been playing around with 18F4620’s (40-DIP), but I’m switching to the 18F2620’s (28-DIP) as I don’t need the extra I/Os on the biped and can’t afford the larger size.
The 4620’s that I have now will go on the biped’s car, where I’ll have more sensors and more room.
I’ve been planning on getting the 10Mhz can (354909CM) and multiplying that by 4 with the PLL.
At 30mA, the current draw isn’t too bad.
I’m using a 3A LDO 5V regulator, too, so I have no worries about overdrawing anything.
I always try to minimize any of those kinds of pitfalls by overkilling my designs.
Methinks that a more accurate clock will be worth the tradeoff, as I might be directly controlling servos in the biped with it, and I’ll definitely be PWMing the FET drivers of the biped car’s speed controller.
Methinks that an accurate clock will go a long way towards minimizing shoot-through (although there’ll be a lot of passives onboard to prevent that).
Ahh… well, I wasn’t aware of that.
That should save me quite a coin, though, as I thought I’d need one for each micro.
Sweet.
I’ve ordered a ton of .1uF bypass caps for all the other components.
10x the amount of recommended Coulumb storage shouldn’t hurt, eh?