Архив метки: Oscillator

Тактовые генераторы в PIC (Microchip)

взято тут http://www.mikroe.com/chapters/view/17/chapter-4-examples/

CLOCK SIGNAL

Even though the microcontroller has a built-in oscillator, it cannot operate without external components which stabilize its operation and determine its frequency (operating speed of the microcontroller). Depending on elements in use as well as their frequencies, the oscillator can be run in four different modes:

  • LP — Low Power Crystal;
  • XT — Crystal / Resonator;
  • HS — High speed Crystal / Resonator; and
  • RC — Resistor / Capacitor.
Oscillator can be run in four different modes

Why are these modes so important? Owing to the fact that it is almost impossible to make a stable oscillator which operates over a wide frequency range, the microcontroller must know which crystal is connected so that it can adjust the operation of its internal electronics to it. This is why all programs used for chip loading contain an option for oscillator mode selection. See figure on the left.

Quartz Crystal

When the quartz crystal is used for frequency stabilization, a built-in oscillator operates at a precise frequency which is not affected by changes in temperature and power supply voltage. This frequency is usually labeled on the crysal casing.

Apart from the crystal, capacitors C1 and C2 must also be connected as per schematic below. Their capacitance is not of great importance. Therefore, the values provided in the table below should be considered as a recommendation, not as a strict rule.

Quartz Resonator

Ceramic Resonator

Ceramic resonator is cheaper, but very similar to quartz by its function and the way of operation. This is why schematics illustrating their connection to the microcontroller are identical. However, the capacitor value is slightly different due to different electric features. Refer to the table below.

Ceramic Resonator

Such resonators are usually connected to oscillators when it is not necessary to provide extremely precise frequency.

RC Oscillator

If the operating frequency is not of importance then there is no need to use additional expensive components for stabilization. Instead, a simple RC network, as shown in figure below, is sufficient. Since only the input of the local oscillator is used here, the clock signal with the Fosc/4 frequency will appear on the OSC2 pin. This frequency also represents the operating frequency of the microcontroller, i.e. the speed of instruction execution.

RC Oscillator

External Oscillator

If it is required to synchronize the operation of several microcontrollers or if for some reason it is not possible to use any of the previous schematics, a clock signal may be generated by an external oscillator. Refer to figure below.

External Oscillator

Regardless of the fact that the microcontroller is a product of modern technology, it is of no use if not connected to additional components. Simply put, the appearance of voltage on the microcontroller pins means nothing if not used for performing certain operations such as to turn something on/off, shift, display etc.