Digit Animation Help
Hey all, im working on a clock project, that is based on three 74HC595 registers shifting out BCD data to 6 BCD to 7 segment driver chips. I'm trying to do a basic scroll right animation, and its turning out really lousy. if you send $f to the decoder, it will blank the digit. so basically i need to shift the following pattern out the 595 array.
Time var byte(3) is my byte array storing the time value
time = $00, $12, $13 for this example time is 13:12:00
$0F,$FF,$FF
$00,$FF,$FF
$20,$0F,$FF
$12,$00,$FF
$31,$20,$0F
$13,$12,$00
i have something put together, but its like 52 lines of code, and doesn't quite animate right.
thanks in advance!
Time var byte(3) is my byte array storing the time value
time = $00, $12, $13 for this example time is 13:12:00
$0F,$FF,$FF
$00,$FF,$FF
$20,$0F,$FF
$12,$00,$FF
$31,$20,$0F
$13,$12,$00
i have something put together, but its like 52 lines of code, and doesn't quite animate right.
BLANK_DIS 'send out $FF,$FF,$FF 'example secs = 22 tmpb1 = secs & $0F 'make secs 02 SWAP tmpb1 'make secs 20 tmpb1 = tmpb1 + $0F 'make secs 2f SHIFTOUT DataIO, Clk, MSBFIRST, tmpb1 ' shift out 2f PULSOUT HC595, 5 pause scrollspeed BLANK_DIS ' blank display SHIFTOUT DataIO, Clk, MSBFIRST, SECS 'shift out 22 PULSOUT HC595, 5 pause scrollspeed BLANK_DIS tmpb1 = mins & $0F SWAP tmpb1 tmpb1 = tmpb1 + $0F SHIFTOUT DataIO, Clk, MSBFIRST, SECS SHIFTOUT DataIO, Clk, MSBFIRST, tmpb1 PULSOUT HC595, 5 pause scrollspeed BLANK_DIS SHIFTOUT DataIO, Clk, MSBFIRST, SECS SHIFTOUT DataIO, Clk, MSBFIRST, mins PULSOUT HC595, 5 pause scrollspeed BLANK_DIS tmpb1 = HRS & $0F SWAP tmpb1 tmpb1 = tmpb1 + $0F SHIFTOUT DataIO, Clk, MSBFIRST, SECS SHIFTOUT DataIO, Clk, MSBFIRST, mins SHIFTOUT DataIO, Clk, MSBFIRST, tmpb1 PULSOUT HC595, 5 pause scrollspeed BLANK_DIS SHIFTOUT DataIO, Clk, MSBFIRST, SECS SHIFTOUT DataIO, Clk, MSBFIRST, mins SHIFTOUT DataIO, Clk, MSBFIRST, hrs PULSOUT HC595, 5 pause scrollspeed
thanks in advance!
Comments
i started off trying to accomplish what you suggested, and hit a wall. i can figure out how to isolate the nibs, but putting them where they need to go in a display buffer array, and figuring out with nibs need blanked is over my head.
here is where i am so far:
Post Edited (skynugget) : 12/8/2009 7:40:03 PM GMT
I know, I know... Assembly is supposed to be "hard." Well, it really isn't and I am frequently adding very efficient Assembly sections to my SX/B programs.
Why don't you ATTACH your full program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
i get what your saying about using a display buffer, but the whole thing that is throwing a wrench in shifting half a byte, i guess.
anyway here is what im working with so far source/schematic, its basically the bs2 ds1302 timer ported over, on top of JohnnyMacs PWM ISR routine that i use for dimming digits.
the thing thats neat about using bcd through the shift registers, is that there is a bcd to anything driver chip out there, i guess that's why i started out the way i did.
Now you could do something like this to scroll the digits left (blanking the right-most display element):
Note that this is not designed to be cute or clever (i.e., optimized), it is meant to be obvious and easy. Running this routine six times with a delay in between will scroll the time off. Now... if you want the seconds to be updating during the scrolling, well, that's going to take some more work. Try this first, then move on to that if it is a requirement.
how about this?
Subs/Funcs:
Declarations:
Post Edited (skynugget) : 12/14/2009 10:08:18 PM GMT