2019/2020 ICS3U Challenge Exercise #2. Pierce Oscillator with LCD Display (inspired by J. Goodwin, ACES '22)
A great many embedded systems projects (including the one we investigate on Friday of this week) depend on the measure of TIME. To ensure the most accurate monitoring of time, or timebase, electronics typically exploits the piezoelectric effect exhibited in quartz crystals in which a tiny amount of voltage is produced when the crystal is deformed. Conversely, when voltage is applied to the crystal, it deforms.
The circuit symbol for a crystal appears to the right.
| Raw Crystal | 32.768 kHz Tuning Fork Crystal (click to expose) |
![]() |
![]() |
In this Challenge you will use your UNO (running to the beat of a 16 MHz Crystal) to monitor and confirm the accuracy of the 32.768 kHz crystal (and load caps) you have in your kit. Your goal is to capture the number of oscillations per second of the tuning fork crystal and update it every second on your LCD screen as shown EXACTLY to the right. The closer the count is to 32768, the higher the precision. Note that 32768 is 215, making it ideally suited for your MCU's binary manipulation abilities.
Your code design will also further reinforce your command of both External and TimerOne Interrupts.
Task.
The Pierce Oscillator is a convenient subcircuit to convert the oscillations of your 32.768 kHz crystal into a digital square wave that can be fed into one (of your two) UNO External Interrupt pins, and monitored. Click on the schematic image to the right to enlarge.
Finally, remember the DES is a drama-free zone.
Future Video:
How a quartz watch works - its heart beats at 32.768 kHz