here's a pseudo code
disable latch
shiftout ser,clk,mode,[digit2,digit1,digit0]
enable latch
looks simple hey!!!
to test it simply shift three different value out and see if you get the good results at the end. after that you'll have to produce your own table to give to a specific digit value the according output pattern to your 7 segments. Can use internal EEPROM or an ARRAY to store them and refer to it.
let's say that (they're not the truth here)
digit=0 OutputTo7Seg=$05
digit=1 OutputTo7Seg=$03
digit=2 OutputTo7Seg=$0A
digit=3 OutputTo7Seg=$06
store your pattern to Internal EEPROM
DATA @0,$05,$03,$0A,$06
after that when you need to convert your digit into 7 segment representation:
read FirstDigit,digit1 'where FirstDigit is the numeric value to be converted into 7 segment representation
Shiftout ser,clk,mode,[digit1] 'send to 7 segments display.
that's a really rough code but suppose to be enough to start...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks