If I understand correctly what you are trying to do then there is a simple software solution.
The following Python code should update multiplexed 7-segment LCDs in a flicker free way.
For testing purposes each LCD is updated for 100000 µs in turn. In a practical application a value like 1000 µs should be used. The period
is set by the REFRESH constant.
The code assumes that a segment is switched on by setting a gpio high. Similarly a LCD is enabled by setting a gpio high. You'd need to invert the logic if your segments/LCD are wired differently.
# Public Domain
import pigpio # http://abyz.me.uk/rpi/pigpio/python.html
# For testing purposes each LCD is refreshed (REFRESH) for
# 100000 microseconds. In a practical application you probably
# want to use a figure in the region of 1000 microseconds.
' ': 0b00000000,
# This defines which gpios are connected to which segments
# a b c d e f g dp
SEG2GPIO=[ 4, 17, 18, 22, 23, 10, 24, 9]
# This defines the gpio used to switch on a LCD
# 1 2 3 4 5
LCD2GPIO=[ 5, 6, 7, 8, 11]
wid = None
showing = *len(LCD2GPIO)
def display(lcd, char):
if char in CHARSET:
showing[lcd] = CHARSET[char]
showing[lcd] = 0
wf = 
for lcd in range(len(LCD2GPIO)):
segments = showing[lcd] # segments on for current LCD
on = 0 # gpios to switch on
off = 0 # gpios to switch off
# set this LCD on, others off
for L in range(len(LCD2GPIO)):
if L == lcd:
on |= 1<<LCD2GPIO[L] # switch LCD on
off |= 1<<LCD2GPIO[L] # switch LCD off
# set used segments on, unused segments off
for b in range(8):
if segments & 1<<(7-b):
on |= 1<<SEG2GPIO[b] # switch segment on
off |= 1<<SEG2GPIO[b] # switch segment off
wf.append(pigpio.pulse(on, off, REFRESH))
print(on, off, REFRESH) # debugging only
pi.wave_add_generic(wf) # add pulses to waveform
new_wid = pi.wave_create() # commit waveform
pi.wave_send_repeat(new_wid) # transmit waveform repeatedly
if wid is not None:
pi.wave_delete(wid) # delete no longer used waveform
print("wid", wid, "new_wid", new_wid)
wid = new_wid
pi = pigpio.pi()
# Set all used gpios as outputs.
for segment in SEG2GPIO:
for lcd in LCD2GPIO:
ck = CHARSET.keys()
# To test loop over character set.
for d in range(len(LCD2GPIO)):
char += 1