Working with oscillator circuit the beating of hearts of circuits.
Crystals are popular in embedded systems because they provide a stable and accurate clock signal, allowing devices to perform tasks at consistent intervals.
Equivalent Circuit (Not important for coding) #
The equivalent circuit is shown as below:
Using Laplace transfer, the impedance of this network can be written as: \(Z(s) = \left( \frac{1}{s \cdot C_1} + s \cdot L_1 + R_1 \right) \parallel \left( \frac{1}{s \cdot C_0} \right) \)
Internal vs. External Clock #
MCUs rely on clock sources for timing, with options typically including internal clocks and external clocks. Many modern MCUs support both, allowing developers to select the best source depending on their application’s needs. The choice between internal and external clocks impacts cost, power consumption, precision, and startup time. Here’s a quick overview of how these factors play into the selection process. Here are some comparisons about these 2 types of clocks.
Factor | Internal Clock | External Clock |
---|---|---|
Cost | Lower cost, no extra components needed | Higher cost, requires crystal and capacitors |
Power | Lower power consumption | Higher power due to crystal driving current |
Precision | Lower accuracy, prone to drift | High precision, stable frequency |
Startup Time | Fast startup | Slower startup (few ms to tens of ms) |