8 Digits with Maxim 7219 and Basic Stamp
ryfitzger227
Posts: 99
Okay. So I've searched the forums, google, etc for the past 2 hours I'd say and can't find really anything about this. Everything I've found has been for 4 digits or lower and everything that talks about an 8 digit was never solved or is to complex for me to read it and understand it.
I've been using the AppKit for the Maxim 7219 and BS2 and got 4 digits working just fine, but when I tried to add in the next 4 digits it stopped working. Here's the code I've been using.
Instead of using a counter like it is in the AppKit, I just set the variable myself. When I set dispVal to something more than 1234 (like 12345678) I get an error message saying "Constant exceeds 16 bits." After doing some research I found out that 12345678 is actually 24 bits. How do I send something like this to the 7219?
I've been using the AppKit for the Maxim 7219 and BS2 and got 4 digits working just fine, but when I tried to add in the next 4 digits it stopped working. Here's the code I've been using.
' {$STAMP BS2} ' {$PBASIC 2.5} DATA_n CON 7 CLK CON 5 Load CON 6 decode CON 9 brite CON 10 scan CON 11 switch CON 12 test CON 15 DecPoint CON 000000 max_dat VAR Word index VAR Nib temp VAR Byte nonZ VAR Bit dispVal VAR Word odd VAR index.BIT0 OUTS = 0 DIRS = $FFFF FOR index = 0 TO 7 LOOKUP index,[scan,4,brite,3,decode,$1F,switch,1], max_dat SHIFTOUT DATA_n, CLK, MSBFIRST,[max_dat] IF odd = 0 THEN noLoad PULSOUT Load,1 NoLoad: NEXT dispVal = 1234 MaxDisplay: nonZ = 0 FOR index = 4 TO 1 SHIFTOUT DATA_n, CLK, MSBFIRST,[index] temp = dispVal DIG (index - 1) IF temp = 0 THEN skip1 nonZ = 1 skip1: IF nonZ = 1 OR temp <> 0 OR index = 1 THEN skip2 temp = 15 skip2: SHIFTOUT DATA_n, CLK, MSBFIRST,[temp] PULSOUT Load, 5 NEXT RETURN
Instead of using a counter like it is in the AppKit, I just set the variable myself. When I set dispVal to something more than 1234 (like 12345678) I get an error message saying "Constant exceeds 16 bits." After doing some research I found out that 12345678 is actually 24 bits. How do I send something like this to the 7219?
Comments
http://classic.parallax.com/Portals/0/Downloads/docs/cols/nv/vol2/col/nv70.pdf
And software attached.
Attached Files
BTW: The Attached file is invalid.
http://www.savagecircuits.com/binarydigitalclock