You said "the budget is paper thin." so usually 74HC etc stuff is cheaper than port expanders.
When I scanned your expander and the new one, I see that there seems to be a lot of settings to be sorted, so I looked for an easier route, hardware and programming.
The shift registers are easy to use, and the program is relatively straight forward.
You store the binary patten of each digit in on board pic eprom starting at location 0, so you have 10 values (led patterns) there 0-9.
you have your x=14 or whatever , THEORETICALLY 00014
If you store that 5 into an array eg numbers(0) = 4 numbers(1) =1 and so on
remember to send the least significant digit out first as that will be the far right hand on the display
you then do a loop something like
FOR COUNTER = 0 TO 4 ' 5 DIGITS
pattern = numbers(counter)
read patten , temp ' get the led patten into temp
then shift out temp to the shift register
next
you now have all the segments for the 5 digits done
with some extra programming you could make the leading "0"s be unlit.




Bookmarks