Page 1 of 1

Using this crystal with a PIC

Posted: Tue Jun 14, 2005 8:39 pm
by Newz2000
Can anyone tell me how to hook this crystal to a PIC 16f84a?<p>Here is a link to the PDF but the pertinent information is (SG51 series):
14 pin DIP package (only 4 pins though)
- pin 1 labeled OE
- pin 7 labeled GND
- pin 8 labeled OUT
- pin 14 labeled Vdd
http://www.gulf-coast.net/ebay/sg-531p.pdf<p>The 16f84a-04 does not have its own clock but instead has pins labeled:
- pin 15 labeled OSC2
- pin 16 labeled OSC1
Diagram located at http://www.mikroelektronika.co.yu/engli ... hapter.htm<p>I'm using 4.5 volts battery pack for now, may use a serial port for power later.<p>Do I need to use two caps for this? I'm not famaliar with this package and most diagrams are not to helpful in this case.<p>Thanks!

Re: Using this crystal with a PIC

Posted: Tue Jun 14, 2005 9:54 pm
by dyarker
Have you looked at the spec sheet at [url=http://www.microchip.com,]www.microchip.com,[/url] page 22, para 6.2?<p>Your SG-51 is not a crystal, it is a crystal oscillator; use spec sheet figure 6-2 (no caps).<p>The figure at mikroelektronika is for using a crystal.<p>Cheers,<p>[ June 14, 2005: Message edited by: Dale Y ]</p>

Re: Using this crystal with a PIC

Posted: Wed Jun 15, 2005 3:08 pm
by bodgy
And a crystal oscillator is connected to OSC1 on the Pic, with Osc2 being an open connection.<p>There will, however, be a 1/4 freq signal on this pin that can be used for other purposes if needed.<p>Though I doubt you'll be needing that facility.<p>Colin

Re: Using this crystal with a PIC

Posted: Wed Jun 15, 2005 4:27 pm
by Gorgon
Hi Colin,
The PIC must also be set in HS,LP or XT mode. NOT in RC mode.<p>TOK ;)

Re: Using this crystal with a PIC

Posted: Wed Jun 15, 2005 8:04 pm
by Newz2000
Thanks for the help everyone... the link to that PDF file gave me the answer about how to hook it up, and it worked ok (very slow) until I switched to HS mode. Then it worked great (It also helped that I MCLR to ground... it worked "funny" without that). For the archives:<p>To switch to HS mode in MPLAB, you have to:
1. From the "Configure" menu choose "Select Device" and do what seems logical, hitting OK at the end.
2. From the "Configure" menu choose "Configuration Bits"
3. Click once on "Oscillator" and the field in the "Setting" column should become a drop down list. From the drop down list, choose the proper mode (for example, HS)
4. Unlike other option windows, simply hit the X to close the window when you're done. There is no "OK" button here.

Re: Using this crystal with a PIC

Posted: Fri Jun 17, 2005 1:57 am
by ezpcb
It's an active oscillator, not a passive crystal. No external circuit needed to make it vibrating. Just connector pin 15 to osc1, osc2 left unconnected.<p>mike