Main Content

Because binary coded decimal clocks are too easy to read.

Binary Coded Octal clock with auto brightness control, based on a PIC16F688, developed with SDCC.

The heart of this minimalist clock is the zero error Bresenham algorithm. It uses the Timer 0 to generate an interrupt at every 256 machine cycles. At every interrupt an accumulator is added by 256 up to the point where it overflows the amount of machine cycles in 1 second (Fclock/4 or 2000000). Every time the overflow occurs, the clock advances 1 second, and since such value is not divisible by 256, the difference is kept to be added to the next cycle. The side effect is that the 1 second interval have some jitter, but it is not even noticed, as the clock itself counts up every 60 seconds, or 1 minute.”

Link to article