HI list, I have a small problem with a max7219 I was hoping to get some help with.
I have 8 led's connected to dig0 as the common and segments a-g and the decimal point connected to individual leds not a 7 segment display.
All I'm trying to do is count from 0 to 255 in binary on the leds so I can learn the chip. It counts properly but doesn't shut off leds while it counts. for example at 0 all led's are off. at 1 d0 is on but when it gets to 2 it turns on d1 and keeps d0 on also. displaying the number 3.... as it goes from 2,4,8,16,32 ect I can see the next power led turn on but it's not turning the others off while counting. kind of latching the values.
I would expect that when sending the number 8 to it that d3 would be on and d2,d1,d0 would be off ect. but they stay on. showing 15
Could someone pls look at my code and point me in the right direction?
everything else works ok on it.
I'm just posting the problem section, all variable setups and port assignments are ok
Thank you
dig0 var word
cr var byte
Mainloop:
Dig0 = $0100 'select digit 0
GoSub DecodeMode
GoSub ShutDownMode
GoSub ScanLimit
GoSub Intensity
Dispig0 = $0100 'select digit 0
For CR=0 To 255
Dig0 = Dig0 | CR
Low Load
DelayMS 1
shiftout Dout,Clk,msbfirst,[Dig0\16] 'no decode
DelayMS 1
High Load
DelayMS 200
Next
GoTo Disp
DecodeMode:
Low Load
shiftout Dout,Clk,msbfirst,[$0900\16] 'no decode
High Load
Return
ShutDownMode:
Low Load
shiftout Dout,Clk,msbfirst,[$0C01\16] '$0C is shut down mode register and $01 = on $00 = off
High Load
Return
ScanLimit:
Low Load
Shiftout Dout,Clk,msbfirst,[$0B00\16] '$0B scan limit register(#of led lines) we have only one so Dig 0
High Load
Return
Intensity:
Low Load
Shiftout Dout,Clk,msbfirst,[$0A09\16] '$0A intensity register $00 is min and $0F is max
High Load
Return
Bookmarks