EMBEDDED SYSTEMS & MICROCONTROLLERS · PAGE 62
Crystals and Clock Circuits
Choosing an accurate time base.
A quartz crystal vibrates at a precise frequency. The MCU's oscillator circuit, with two small load capacitors, keeps it running. The datasheet gives the capacitor value to use.
Internal RC oscillators need no parts but drift with temperature and voltage. Serial links and clocks usually want a crystal.
Keep the crystal and its capacitors close to the chip with short tracks.