Академический Документы
Профессиональный Документы
Культура Документы
Beginner Project 1
Basic Crystal
Oscillator Circuit
The function of an oscillator
circuit is to provide an accurate and
stable periodic clock signal to a
microcontroller. The frequency of
this clock signal can range from a
few kilohertz to tens of megahertz
and determines how quickly the
microcontroller executes its in-
structions.
Most microcontrollers include This schematic diagram illustrates both the clock oscillator and reset circuits.
a clock driver circuit which is de-
signed to drive a quartz crystal into The clock circuit consists of When the capacitance of C1 or
oscillation. The clock driver cir- capacitors C1 and C2, a quartz C2 is shown as a range of values,
cuitry built into the PICmicro fam- crystal or ceramic resonator Y1, select a higher capacitance for
ily is very flexible and allows for and a series resistor, R3. The val- lower frequencies of operation, and
four different clocking options: ues of capacitors C1 and C2 is de- a lower capacitance for higher
clock signal supplied from another termined by both the clock speed clock frequencies. For example,
oscillator, an R-C clock (based on at which you intend to run the when using the XT oscillator mode
a resistor-capacitor charging time PICmicro, and by the selection of with a 100 kHz quartz crystal, se-
constant), a ceramic resonator, or a quartz crystal or a ceramic reso- lect a value of C1 close to 30 pF
a crystal oscillator. nator as the clock source. Use the and a value of C2 close to 300 pF
An R-C clock circuit is the sim- table as a guide to select the ap- for the best performance.
plest but does not provide accurate propriate capacitors.
timing since both resistor and ca-
pacitor values can vary greatly with Oscillator Type Frequency Range C1 C2
temperature. Crystal oscillator and
XT - Resonator 1 - 4 MHz 20-330 pF 20-330 pF
ceramic resonator-based clock cir-
cuits provide the most stable and HS - Resonator 8 MHz 20-200 pF 20-200 pF
accurate timebases, and require LP - Crystal 32 - 200 kHz 15 pF 15 pF
only a few extra parts than a sim-
XT - Crystal 100 kHz - 1 MHz 15-30 pF 15-300pF
ple R-C oscillator (see the sche-
matic diagram, above). HS - Crystal 2 - 20 MHz 15 pF 15 pF
LP is low power mode, XT is a regular oscillator, and HS is high speed mode.
Notes: