Author Options:

Microcontroller help! Answered

So I'm working on a project to build a binary clock style watch, though I have very limited experience and knowledge about circuitry and microcontrollers. As of right now I have found a relatively simple project on this site I wish to replicate and downsize to fit in the size of a watch.

The design of the circuit is based off the layout in this project:


Now I have read up on microcontrollers and microprocessors. I also read some stuff about oscillators and how they can work to essentially synchronize the internal clocks of microcontrollers making them more accurate for clock uses.

First is this true that a crystal oscillator can improve the accuracy of a microcontroller? And if so, how could I add a 16.000 Mhz crystal oscillator to the circuit presented above? (I want to use a 16.000 Mhz oscillator because the code written for the microcontroller is based on the 16 Mhz internal clock, so this should line up fine)

Thanks if you can answer these questions!


The forums are retiring in 2021 and are now closed for new topics and comments.

1 year ago

As answered in your other thread: Pins 2 and 3.

Yes: The internal Clock is a RC-Oscillator and can be quite inaccurate (+/-5% at least) where a crystal is measured in ppm (Parts per Million or 0.0001%) and therefore MUCH more precise. BUT: You dont need a 16MHz external clock. The internal clock is more than good enough... What you want is an external TIMING clock! There are specialised 32k-Crystals (Exactly 32'768 Hz) which are driven to ultra low power consumption exactly for this usage. With every clock, you trigger an interrupt and count up one tick. If you reach the 32768-mark you know: 1 sec has passed.
As the Counting is an action which is super fast in the CPU, you can put the CPU back to sleep in notime and have it sleep for like 99.99% of the time... And waking up 32k times is better in terms of energy than waking up 16'000k times per second.