There are many designs on the net for this - many use a shift register, daisy chained to the next one,(74hC595s) rather than use your port expander, you would still use the uln to provide the current. many 7 segs have a decimal point so that makes a nice 8 to fit byte format.
Your digits would be sent as a bytes shifted out in bits to the register so your digit "1" would be %00000011, digit 2 would be %01101101, A is the least sig bit in this example. So any segment with a 1 will be on 0 =off. 8th bit for decimal point if used , but does not need to be connected as you only have 7 output on uln, but you must shift out the 8 bits regardless.
Have a look here http://www.picbasic.co.uk/forum/showthread.php?t=981 and post 3 - there is a pdf schematic.
to set up your 5 digits use a look up (or is it down) table with just 0-9. so for a 1 you would have %00000011 = $03 for 2 %01101101 =$6d and so on.
you have 5 digits , look up value for first and shift it out, same for the second and so on.
Bookmarks