2-Wire LED Display

This display is the basis of a larger project, which consists of 4 x 4-digit clock displays connected to the 8 lines of PortB. The software below is just a small part of that project - it merely starts the display at 00:00 and ticks once/sec until it reaches 99m59s, when it rolls over to 00:00.

To turn this into a time-of-day clock all that is needed is to change the IRQ counting. The Timer0 IRQs in this software come at 200/sec. At present they are divided by 200 to give 1Hz (although the display is refreshed on each IRQ to minimise flicker). Using a /60 counter on the 1Hz would mean the display data could be updated every minute instead of every second. This will make the two left-hand digits Hh, and these should be limited to 12 or 24. The colon (formed by two 3mm LEDs) could be connected to another PIC pin (via a grounding transistor in a similar fashion to those used on the digit cathodes) which has an IRQ/100 toggle output. This would make the colon flash at 1Hz. 500mA BC337s were used for the prototype, but 100mA BC548s would do.

An alternate use would be change the IRQ rate to 100/sec and use this as stop-watch with a resolution of 1/100th of a second. In that case the colon can be a single LED as a decimal point.

This software also differs from the full project in that the full project has periodic mains synchronisation. This software uses just the crystal and will be subject to some drift and inaccuracy.

There is no need to use the 74HC164's Reset pin, as long as the clock pulses are received in bunches of 8 by the 164. A PIC pin can be used though to explicitly reset the 164 before data is sent. Also, there is no need to use the 4511's Latch pin, as the data goes from the inputs straight to the outputs. With 270 ohm resistors the LED is quite bright. A 4511's outputs match the orientation of the LED display inputs with this particular PCB layout. I use one board for the LEDs and another joined at right-angles connected by 7 component lead cut-offs.

LED display circuit

Prototype display

Download  2-wire asm, hex & circuit (54kB)    PCB patterns may need resizing and are a suggested layout only

Back to Displays Menu