Hello all
I'm using a MAX7219 LED/7 segment driver with a 18X.
When I download the program to the chip, it initialises the MAX7219 fine, and everything works great.
But if I disconnect the battery, and then reconnect it, the seven segments go blank, and nothing happens. It looks like the initialisation fails.
If I place a 500 ms pause in between every initialisation command, it works fine again on programming, and it also works on diconnect / reconnect. but after doing that... the display is much dimmer!
I'm sure there is a reason, but it beats me. And none of the sample code I have seen includes delays...
Anyone have any ideas about what might be happening?
I have a 10k resistor connected between Iset and GND. Code below....
I'm using a MAX7219 LED/7 segment driver with a 18X.
When I download the program to the chip, it initialises the MAX7219 fine, and everything works great.
But if I disconnect the battery, and then reconnect it, the seven segments go blank, and nothing happens. It looks like the initialisation fails.
If I place a 500 ms pause in between every initialisation command, it works fine again on programming, and it also works on diconnect / reconnect. but after doing that... the display is much dimmer!
I'm sure there is a reason, but it beats me. And none of the sample code I have seen includes delays...
Anyone have any ideas about what might be happening?
I have a 10k resistor connected between Iset and GND. Code below....
Code:
symbol dout = 2
symbol cs = 3
symbol cl = 1
symbol outreg = b1
symbol outval = b0
symbol outword = w0
symbol bitcounter = b2
symbol tths = b3
symbol thos = b4
symbol hnds = b5
symbol tens = b6
symbol ones = b7
symbol counter = b8
symbol n0 = %01111110
symbol n1 = %00110000
symbol n2 = %01101101
symbol n3 = %01111001
symbol n4 = %00110011
symbol n5 = %01011011
symbol n6 = %01011111
symbol n7 = %01110000
symbol n8 = %01111111
symbol n9 = %01111011
symbol decode = 9
symbol brite = 10
symbol scan = 11
symbol display = 12
pause 500
outreg = decode
outval = 0
gosub shiftout
pause 500
outreg = brite
outval = 10
gosub shiftout
pause 500
outreg = scan
outval = 0
gosub shiftout
pause 500
outreg = display
outval = 1
gosub shiftout
pause 500
main:
for counter = 0 to 9
lookup counter, (n0,n1,n2,n3,n4,n5,n6,n7,n8,n9), outval
outreg = 1
gosub shiftout
pause 100
next counter
goto main
shiftout:
low cs
for bitcounter = 0 to 15
if bit15 = 1 then
high dout
else
low dout
endif
high cl
low cl
outword = outword * 2
next bitcounter
high cs
low cs
return