Let's Make Robots!

Crystal Oscillator

Hello to my fellow robojunkies!

I'm trying my hand at building my own circuit for my next project, and I've finally (I hope) picked up all the parts I need, but I've got a question. The part SAYS it's right, but it's so much bigger than the one on the project board.

Is THIS

jan_09_004.jpg

 THIS?

 4hz.gif???

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks for all your input.

I think i'll just spring the 1 dollar for a ceramic resonator, though. K.I.S.S., know what i mean?

Why did you get a 4Mhz crystal? Are you using a 28, 28A or 28X? These are the only chips that require the resonator. See manual 1 - minimum circuit, note 3 (resonator).

If you are using a 28X1 or X2 then the resonator is optional as they can generate 31KHz, 125KHz, 250KHz, 500KHz, 1MHz, 2MHz, 4MHz and 8MHz internally. See the setfreq command in manual 2.

I use a 16MHz resonator because it is the only other frequency that the servo command will work with and it doubles my processing speed.

yeah, didn't notice that it was optional (or three pin) until a minute ago. the local electronics wholesaler only had this kind. the schematic in the manual implies that it's required, since it says it's the minimum circuit. the good news, i can still move on tonight.

so what use can i find for the one i have?

The crystal should be more acurate than a resonator if it's used correctly. It would allow for more reliable serial comms at the higher frequencies or more accurate data from a pulsin command.

4MHz_crystal_oscillator_.jpg

I found a 4MHz crystal oscillator in a book for a pic processor. This diagram shows you how to add two 22pF capacitors and make it the equivalent of a 3 pin resonator. The pin numbers are the physical pins of the picaxe 28X1 that you need to connect this to. The value of the capacitors would need to be changed if a different frequency crystal is used. 

The capacitors depends on the crystal, not the frequency. You have to check the datasheet of the crystal to see the load capacitance. Take this list, for example: http://dk.mouser.com/Search/Refine.aspx?N=5115911+4294622863+4294741289&Keyword=crystal+4mhz&FS=True. They use 10, 16, 18 or 20pF caps. None of them use 22pF.

It is a very complex subject, The load capacitance recomended by the manufacturer will give you the most precise frequency. Higher or lower capacitances will tweak the frequency. This change (delta frequency) is very tiny and measured in ppm (parts per million). As mentioned in one tutorial, stray capacitance can also play a role.

Calculon can probably use as low as 16pF and as high as 32pF. He'd need an oscilloscope or frequency counter to check the actual frequency if he wants precisely 4MHz.

This is a PDF on the subject.

 

Thanks for the links, interesting reading, good stuff to have reviewed.
That is only part of it. Frequency also plays a factor and the load. This circuit I've shown is specifically for a pic processor running at 4MHz. In the instructions, no mention of crystal brands. The original circuit I got this from is "versatile timer" from "Silicon Chip" magazine. If a certain crystal was required then they would mention it in their puplication.

you rock.

You've bought a crystal, the schematic shows a ceramic resonator. Notice the schematic shows 3 connections not two. You could use the crystal but you need to add some ceramic capacitors of the right value. I cannot advise you on that as last time I tried I ended up with 12Mhz from a 4Mhz crystal. Something to do with harmonics.

I ordered mine from here. The delivery is slow but the parts are cheap. Make sure you order the 3pin version!