At 03:10 PM 9/3/99 -0500, Matthew Fries wrote: >Here is a tricky situation: I cannot seem to get any of my 16F84-10/P PICs >to run using a crystal. The code simulates nicely in MPLAB, and I can get >the same code to run if I use the RC setting and components, but not a crystal. >The spec sheet refers to serial and parallel resistive crystals. How can I >tell what kind I have. There are no useful markings on the xtals (other than >the frequency and the mfgr). >Is there some excess capacitance in the breadboard that is keeping the >crystal from oscillating? >Should I enable the OST? >Or maybe the PWRT? 1. The series resonant frequency of the crystal (Fr) is only 0.1% less than the anti-resonant frequency (Fa). The series circuit operates the crystal at Fr, and the parallel circuit operates it at slightly below Fa. Since the two frequencies are very close, the only side-effect of using a series vs. parallel crystal is that you will not be operating exactly at the frequency labeled on the crystal. This will result in very small timing errors in your program (i.e., 0.1% different instruction times). For example, if you use a "series" spec'd crystal in a parallel configuration, you will possibly be operating at 4.004 MHz instead of 4.0000 MHz. This should be irrelevant to the electronic operation of the circuit. 2. Remember to declare the clock as XT for frequencies at or below 4 MHz and HS for frequencies above 4 MHz. 3. Use of a crystal with 2-22pF capacitors will normally work fine. You may want to play with the sizes, since you are trying to operate on a breadboard. You should build a simple 74HCU04 or 74C04 inverter oscillator to make sure you can get the crystal to oscillate on your breadboard. 4. Check the crystal frequency with a frequency counter or oscilloscope. It may or may not be oscillating. You need to know which. If it is, you may have some other problem. (E.g., MCLR etc.) ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causae scire" ================================================================