PDA

View Full Version : Config/Connections for using 4-pin Oscillators



RossWaddell
- 14th June 2012, 20:27
Up to now I've been using the 2-pin 20Mhz crystal oscillators (with [2] 22pF caps) for my projects were timing accuracy is very important. I've just now picked up a 20Mhz crystal module (not sure about the naming convention - the datasheet is here http://www.raltron.com/products/pdfspecs/clock_co1-co13.pdf) but I'm not sure how to connect it to a PIC16F1825 (or 12F629, or 12F683, all used in various projects) if the 14 pin DIP package has only 1 output (pin 8). Does it go to OSC1/CLICKIN? Do I still need caps (I don't think so but want to check)? And do I still use the same device fuse config as before (HS_OSC)?

PIC16F628A (PBP v2.60c)


@ __config _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_OFF & _CPD_OFF

Megahertz
- 14th June 2012, 22:32
It seems that output pin pf the crystal will be connected to the OSC1 pin with an appropriate capacitor also grounding the OSC1 pin. For 20 MHz I can suggest similar values to 15-20 pf which you used before.

RossWaddell
- 14th June 2012, 22:37
Thanks Megahertz. If I still have to use a 22pF cap then I haven't saved myself as much in the way of components as I'd hoped. I had hoped to find a better choice than resonators which aren't as accurate.

Megahertz
- 14th June 2012, 22:41
If accuracy is not on top of your list, why don't you just put a resistor from 5V to OSC1 pin and a capacitor from OSC1 pin to Gnd.

RossWaddell
- 15th June 2012, 00:11
You misunderstood me - accuracy is of paramount importance, which is why I don't want to use a resonator (which also saves on components but isn't accurate enough)

Darrel Taylor
- 15th June 2012, 02:12
TTL oscillators do not require any additional components.

Connect it to OSC1/CLKIN on the 1825 and use ECH mode ...
--> ECH: External Clock, High-Power mode (4-32 MHz): device clock supplied to CLKIN pin

That frees up the OSC2/CLKOUT pin for general I/O.

On the 629 and 683 there is only one EC mode, but it works the same as ECH on the 1825.

RossWaddell
- 15th June 2012, 14:32
Thanks Darrel!