marcos.placona
Senior Member
Hi guys,
I've been digging into this forum for all the possible information I can get about the usage of MAX7219.
So far I've got it well wired with my picaxe 18x and a 7segment display CC.
The code I'm trying to use looks like this one:
I know it's been discussed a lot here, specially by MartinM57, who seems to be the MAX7219 master.
The parts I highlighted in bold, are the parts I didn't really understand, even after reading a re-reading the datasheet many times. I know it's using hex, and I also wanted to take this opportunity to ask you guys about which sort of table do you use to know exactly what hex code to use (can you send me a link please?), as well as how to get their values.
There's a part which is highlighted in red, and I'm sure the problem is there, it says:
b0=$03 '=4 digits I wanna know why $03 is equal four digits.
Also, the part in light grey, is the part I removed from the code, as I'm still testing it with just one 7 segment display (will multiplex later).
So, I believe that considering $03 is equal 4 digits, I should use $00 to say that I'll just be using one digit.
I've tried that, but it didn't work, and also tried with $01.
Also, on the display part I have:
b1=1:b0=5 'digit 1 shows "5" So I wanted to display the number five on the first seven segment. On max 7219, you have the digits starting from 0
So I believe that the b1 = 1 corresponds to digit 0, if you consider that it's like an array that has it's first index starting from 0 (my guess).
As it didn't work, I changed the wiring to go to DIG 1 on the max7219, but also no luck.
Every time I program my picaxe with this code, I get a different result. Sometimes it the 7 segment lits itself up as a whole, sometimes I get just parts of it, sometimes nothing and so on.
I'm sure it has something to do with the code, but I still couldn't spot what's wrong.
I can send pictures of the breadboard in case you wanna see it, but I've checked it about 100 times to see if there was nothing wrong.
Any sort of help you can give me would be much appreciated.
Thanks for reading this massive post,
I've been digging into this forum for all the possible information I can get about the usage of MAX7219.
So far I've got it well wired with my picaxe 18x and a 7segment display CC.
The code I'm trying to use looks like this one:
Code:
symbol DIN = 0
symbol LOAD = 2
symbol CLK = 7
low DIN
low LOAD
low CLK
[B]b1=$09 'decode mode
b0=$ff '=yes, all digits=BCD [/B]
gosub shiftout
[B]b1=$0a 'intensity
b0=$0f '=max[/B]
gosub shiftout
[COLOR=Red][B][COLOR=Black]b1=$0b 'scan limit[/COLOR]
b0=$03 '=4 digits[/B][/COLOR]
gosub shiftout
[B]b1=$0c 'shutdown mode
b0=$01 '=normal[/B]
gosub shiftout:
[B]b1=$0f 'display test
b0=$01 '=all on[/B]
gosub shiftout
[B]b1=$0f 'display test
b0=$00 '=normal[/B]
gosub shiftout
[B]b1=1:b0=5 'digit 1 shows "5"[/B]
gosub shiftout
[COLOR=Silver] b1=2:b0=0 'digit 2 shows "0"
gosub shiftout
b4=76 'number to be displayed
b1=3:b0=b4/10 'digit 3 shows "7"
gosub shiftout
b1=4:b0=b4//10 'digit 4 shows "6"
gosub shiftout[/COLOR]
stop
shiftout:
for b5=1 to 16
w6=w0 & $8000
low DIN
if w6=0 then bit_is_low
high DIN
bit_is_low:
pulsout CLK,5
w0=w0*2 '<< (shift bits left)
next b5
pulsout LOAD,5
return
The parts I highlighted in bold, are the parts I didn't really understand, even after reading a re-reading the datasheet many times. I know it's using hex, and I also wanted to take this opportunity to ask you guys about which sort of table do you use to know exactly what hex code to use (can you send me a link please?), as well as how to get their values.
There's a part which is highlighted in red, and I'm sure the problem is there, it says:
b0=$03 '=4 digits I wanna know why $03 is equal four digits.
Also, the part in light grey, is the part I removed from the code, as I'm still testing it with just one 7 segment display (will multiplex later).
So, I believe that considering $03 is equal 4 digits, I should use $00 to say that I'll just be using one digit.
I've tried that, but it didn't work, and also tried with $01.
Also, on the display part I have:
b1=1:b0=5 'digit 1 shows "5" So I wanted to display the number five on the first seven segment. On max 7219, you have the digits starting from 0
So I believe that the b1 = 1 corresponds to digit 0, if you consider that it's like an array that has it's first index starting from 0 (my guess).
As it didn't work, I changed the wiring to go to DIG 1 on the max7219, but also no luck.
Every time I program my picaxe with this code, I get a different result. Sometimes it the 7 segment lits itself up as a whole, sometimes I get just parts of it, sometimes nothing and so on.
I'm sure it has something to do with the code, but I still couldn't spot what's wrong.
I can send pictures of the breadboard in case you wanna see it, but I've checked it about 100 times to see if there was nothing wrong.
Any sort of help you can give me would be much appreciated.
Thanks for reading this massive post,