On Hackaday.io, [danjovic] gift clOCkTAL, a simple LED clock For those of us who are struggling with the concept of easy reading time.Put the binary clock aside, you are simple, Let’s talk about binary coded octal. Yes, it is one thing.We leave it to [danjovic] Describe how to read the time from it:
Don’t try to use 6 bits for math operations. The trick to reading this clock is to read every 3 digits in the binary, multiply the MSB by 8, and then add it to the LSB.
simple. If you are awake enough, that is. In any case, we really like the streamlined original construction method using perforated boards and waste wood. No details are hidden here. The circuit is very simple, based on the minimum configuration required to drive the PIC16F688 and a small number of LEDs arranged in a 3×4 matrix.
An interesting detail is the use of Bresenham algorithm Obtain one event per second required for tracking time.No, this is not more famous Bresenham line algorithm You may be more familiar with it, it is much simpler, but it works the same as replacing expensive arithmetic division operations with incremental errors. The original Bresenham algorithm was designed for XY plotters with limited resolution and was designed to allow movement that is not perfectly proportional to that resolution. It was developed as a method of approximating lines, and then extended to cover circles, ellipses, and other types of drawable objects.
Bresenham’s Algorithm allows you to create the events you want, any Period from any Oscillator frequency, which is really very useful. Now it is obvious that you will not get something in vain. The disadvantage is periodic jitter, but at least it is deterministic. The way it works is to alternate the calculation period between two power-of-two division ratios (or something easy to create from them) so that the average period is what you want. There are errors from period to period, but in general these errors will not accumulate, and we have the required average period.Example given [Roman Black]The description is to alternate 16 cycles and 24 cycles to get an average of 20 cycles.
The software aspect of things can be passed to Clock GitHub It uses Small device C compiler It supports quite a few devices, in case dear readers, you haven’t encountered it yet.
This video shows the clock passing a simple test that demonstrates the dimming of the LED in response to ambient light. All in all, this is a very simple and effective build.