After finishing my TTL clock I was aware of limitations of that design. Not only are the chips old and would cost money to obtain (unless you have them in your
junkspares box already) but they consume a fair amount of current (I measured about 70-80 mA for the LS TTL model). More serious is the reliance on the 32768 Hz crystal, which drifts, requiring adjusting the time now and then. That TTL clock design was only for my friends to brag how they have 30-40 year old ICs working in their clock.
I could use a modern MCU to provide the timing, taking advantage of a corrected oscillator, an RTC board, or even sources like NTP or GPS. This would also consume less current and allow a better user interface. MCUs like the STM8 are very cheap. So what I decided to do is to partition out the display portion. The display would also be useful for other projects. Linear applies to the layout of the LEDs, not that it's an analog circuit.
- It should have a serial interface to minimise the number of interface lines
- It should use easily available chips
- It should be cheap to fabricate, ideally under 100x48 mm so that you can fit 2 on a cheap PCB
- It should be versatile
The obvious candidates for the chips are shift registers. The 74HC595 and the later TPIC6x595 are designed precisely for this kind of application. The latter is a power shift register and overkill, but the former is readily available and cheap.
The design is taken right out of the chip datasheets, hence the uninnovative. However I wanted to make it versatile. These are the things I have designed in:
- You can populate as few or as many of the 16 LEDs as you need, although you still have to provide all 16 bits of data
- There is no restriction on the mix of coloured LEDs used as long as they are happy with the voltage supply. But you may have to match efficiency for them to look roughly equally bright
- The shift register is rated from 2V to 6V. Although the forward voltage of the LEDs means 3.3V is probably the lower limit. 5V works of course
- The 74HC595 being CMOS is equally good at sourcing or sinking current, so you can source or sink current to the LEDs, selected by an assembly time jumper
- You can optionally control the /OE line for PWM control of the brightness. This is jumper selectable
- There is one optional LED 17 with a separate connection which you can use for other indications
- The circuit fits in 100x48 mm so you can panelise 2 to a 100x100 PCB for cheap fabrication
- A couple of resistor networks are used to reduce the footprint and soldering
- You can orient the board horizontally or vertically as suits your project
So the minimum number of lines required to drive it, aside from the + and - power lines, is 3: DATA, CLOCK, and LOAD. The last is to strobe the data to the output registers so that you don't see the LEDs display the shifting data. The optional lines are: /OE for PWM, and LED17 for the extra LED.