Oscillators are often found built into microcontrollers and FPGAs and provide clock signals for internal logic. However, internal oscillators can be unreliable when it comes to reliable timing. in those cases, external oscillators are used.
Crystal components are also used to produce clock signals. Crystals are designated with the identifier X, Y, or xtal, while oscillators are identified with OSC, IC or U. IC or U.
The 32.768kHz crystal is commonly found in electronic components, as they provide a precise 32.768kHz frequency, which is used to keep time. Real-time clock ICs are almost always powered by an external 32.768kHz crystal, and some microcontrollers may include an internal real-time clock requiring an external crystal. The 32.768kHZ crystal is available in both through-hole and SMD packages. Through-hole packaging looks like a small metal cylinder and SMD packaging has a slender body with four connectors.
32.768kHz crystals are not the only type of crystal available. They come in various shapes, sizes, and frequency levels. As technological strategies have changed with time, the size of crystals has shrunk in electronic designs. They are now typically used as a surface mount as opposed to through-hole assembly. Crystals are typically made with plastic housings and are easily identifiable with their natural frequency of resonance printed on them. They’re also available as metal shielded parts and come with 2 to 6 pins attached.
Oscillators are modules that integrate the components needed to create a square wave. Oscillators are available in various types of packaging and frequencies, but are almost always square or rectangular shaped and have the frequency of their output wave printed on their lid.
Oscillators have four pins: two for power, one for output, and one often left unused. Oscillators and crystals are often used to describe one another but they’re actually different; a crystal is a piece of quartz crystal between two electrodes, while an oscillator includes a crystal and other integrated circuits to produce a square wave.
A real-time clock can either be a dedicated chip or integrated into a larger microcontroller and most often contains a crystal. Most modern devices that have an internet connection no longer require RTC integration, since they can easily request it from a public time server.
However, many devices (including computers) do have a real-time clock that allows them to keep time. In order for a powered-off device to track time, it needs a small coil cell is used to retain power. The coil cell continues to internally track the day, month, and year while a device is powered down. You can identify real-time clocks by the presence of a coin cell near a microcontroller or IC.
Note: Dedicated real-time clocks are often in DIP-8 or SOIC-packages.