Aqui te dejo esto ojala te pueda servir amigo , solo es con dos displays pero es bastante similar asi q no tendras problemas
'****************************************************************
'* Name : "DisplaysMultiplexados.BAS" * *
'* Author : Manuel Rodríguez *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 01/04/2007 *
'* Version : 1.0 *
'* Notes : Este programa nos permite ver como se multiplexan *
'* : dos display de 7 segmentos para un contador *
'****************************************************************
i var byte ' variable "i"
j var byte ' variable "j"
unid var byte ' variable Unidades
dece var byte ' variable Decenas
cuenta var byte
trisa = 0 ' Puerto A como salida
trisb = 0 ' Puerto B como salida
unid = 0
dece = 0
cuenta = 0
inicio:
gosub UNIDADES
pause 10
gosub DECENAS
pause 10
goto inicio
Unidades:
cuenta = cuenta + 1
lookup i , [63,6,91,79,102,109,125,7,127,111] , unid
porta = 2
portb = unid
if i >=10 then
i = 0
endif
If cuenta >= 50 then
i = i + 1
CUENTA = 0
endif
return
Decenas:
if i >= 10 then
j = j +1
if j >= 10 then
j = 0
endif
endif
lookup j , [63,6,91,79,102,109,125,7,127,111] , dece
porta = 1
portb = dece
return
end