Page 1 of 1

SN74HC595 Multiplexed 7 seg LED display

Posted: Wed Feb 25, 2026 7:21 pm
by mnfisher
A simple display (4 digit) using a shift register.

A couple of points:

1) Pull the OE (output enable) pin to ground either in code or in hardware.
2) Multiplex needs to be called regularly - ideally use an interrupt - as per demo. However it could be called in a loop (with a delay). Something like 240Hz is ideal. Setting up a timer interrupt for each MCU is slightly tricky - so left to the user here.
3) Multiplex bit-bangs the data to the shift register. I tested on an Arduino (16MHz) - there is a a chance that some MCUs might be too fast - add some 1uS delays (in the code but disabled here) I've not tested this - it might cause issues on some MCUs (esp32) depending on how the delay is implemented in FC.
4) The display needs to be connected to the shift register segment A to Qa - B to Qb etc with dp to Qh. Assuming standard segment layout. For common cathode the component inverts the data - not tested (I don't have any displays like this) - polarity can be set in properties.

The Display macro takes a decimal point position - and attempts to 'pad' with 0s rather than have leading spaces (so 0.001 not "0. 1" or " . 1")

Negative numbers are not handled (nor the possible 7 seg character set (A, B, C, E, H, L etc)))

It simulates (sort of) - the 2d panel component just displays the value...

Martin