Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
© 2009 Microchip Technology Inc. DS39700C-page 6-31
Section 6. Oscillator
Oscillator
6
6.14 DESIGN TIPS
Question 1: When looking at the OSC2 pin after power-up with an oscilloscope, there is
no clock. What can cause this?
Answer: There are several possible causes:
1. Entering Sleep mode with no source for wake-up (such as WDT, MCLR
or an interrupt).
Verify that the code does not put the device to Sleep without providing for wake-up. If it is
possible, try waking it up with a low pulse on MCLR
. Powering up with MCLR held low will
also give the crystal oscillator more time to start-up, but the program counter will not
advance until the MCLR pin is high.
2. The wrong clock mode is selected for the desired frequency. For a blank device, the
default oscillator is FRCDIV. Most parts come with the clock selected in the Default mode
which will not start oscillation with a crystal or resonator. Verify that the clock mode has
been programmed correctly.
3. The proper power-up sequence has not been followed. If a CMOS part is powered through
an I/O pin prior to power-up, bad things can happen (latch-up, improper start-up, etc.). It
is also possible for brown-out conditions, noisy power lines at start-up and slow VDD rise
times to cause problems. Try powering up the device with nothing connected to the I/O,
and power-up with a known, good, fast rise power supply. Refer to the power-up informa-
tion in the specific device data sheet for considerations on brown-out and power-up
sequences.
4. The C1 and C2 capacitors attached to the crystal have not been connected properly or
are not the correct values. Make sure all connections are correct. The device data sheet
values for these components will usually get the oscillator running; however, they just
might not be the optimal values for your design.
Question 2: Why does my device run at a frequency much higher than the resonant
frequency of the crystal?
Answer: The gain is too high for this oscillator circuit. Refer to Section 6.5.2.4 “Determining
the Best Values for Oscillator Components” to aid in the selection of C2 (may need to be
higher), Rs (may be needed) and clock mode (wrong mode may be selected). This is especially
possible for low-frequency crystals, like the common 32.768 kHz.
Question 3: The design runs fine, but the frequency is slightly off. What can be done to
adjust this?
Answer: Changing the value of C1 has some effect on the oscillator frequency. If a series reso-
nant crystal is used, it will resonate at a different frequency than a parallel resonant crystal of the
same frequency call-out. Ensure that you are using a parallel resonant crystal.
Question 4: What would cause my application to work fine, but then suddenly quit or
lose time?
Answer: Other than the obvious software checks that should be done to investigate losing time,
it is possible that the amplitude of the oscillator output is not high enough to reliably trigger the
oscillator input. Also, look at the C1 and C2 values and ensure that the device Configuration bits
are correct for the desired oscillator mode.
Question 5: If I put an oscilloscope probe on an oscillator pin, I do not see what I expect.
Why?
Answer: Remember that an oscilloscope probe has capacitance. Connecting the probe to the
oscillator circuitry will modify the oscillator characteristics. Consider using a low capacitance
(active) probe.
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ32MC10X-Reference_Manual-Section6-Oscillator.pdf