Tim Vukman
New Member
Good Afternoon:
I would appreciate some troubleshooting suggestions.
I am having a challenge with getting a MAX7219 to run 4 CC 7 segment display digits.
I have all of the segments joined on a bus and with the cathodes grounded, +5 to any segment on the bus lights up the segment on all 4 displays.
The bus is wired to each of the corresponding segments on the 7219.
I am using digit0 to digit 3 on the input side of the 7219. DIN, CLK and Load are tied low with 10K resistors. I have a 10K resistor from pin 18 to pin 19 for the ISET line.
From my 28x, Output 7 feeds the data to DIN. Output 6 provides the Load and Output 5 takes care of the clock.
I can see my outputs with debug on as I have leds on every output. From what I can see, the software is operating properly.
My thanks to MartinM for the code. I stripped down the tach / advance code that he had posted here in the forum. I have tried a couple other samples but this one clearly demonstrated to me how the bits get moved out of the 28x.
I can't seem to get any sign of life to the 7 segment displays. I have the 7219 data sheet pretty much memorized and I can see when the code enters the "test Digit". Nothing lights up, - ever.
I have replaced the 7219 in the event that it might have been the problem, but still no luck.
The code is here:
'28x
'7219 version 4
symbol displaythousand = $c0
symbol displayhundred = $c1
symbol displayten = $c2
symbol displayunit = $c3
'7 segment multiplexing
symbol load_7219 = 6
symbol din_7219 = 7
symbol clk_7219 = 5
'blank value for display
symbol display_blank = $0F
'max7219 registers
symbol decode_mode = $09
symbol intensity = $0A
symbol scan_limit = $0B
symbol shutdown = $0C
symbol digit_test = $0F
start:
poke displaythousand, display_blank
poke displayhundred, display_blank
poke displayten, display_blank
poke displayunit, display_blank
'initialize 7219
gosub initialize_7219
'turn on test mode
b0 = digit_test
b1 = $01
gosub send_data_7219
pause 1000
'turn off test
b0 = digit_test
b1 = $00
gosub send_data_7219
end_start:
'set displays zero
poke displaythousand, 0
poke displayhundred, 0
poke displayten, 0
poke displayunit, 0
gosub show_display
Main:
w6 = 82
w6 = w6*60
b0 = w6 / 1000
poke displaythousand, b0
b0 = w6 // 1000 / 100
poke displayhundred, b0
b0 = w6 // 100 / 10
poke displayten, b0
b0 = w6 // 10
poke displayunit, b0
gosub show_display
goto main
end
initialize_7219:
b0 = decode_mode
b1 = $FF ' code b decode all digits
gosub send_data_7219
b0 = intensity
b1 = $0F
gosub send_data_7219
b0 = scan_limit
b1 = $03
gosub send_data_7219
b0 = shutdown
b1 = $01
gosub send_data_7219
return
show_display:
peek displayunit, b1
b0 = $04
gosub send_data_7219
peek displayten, b1
b0 = $03
gosub send_data_7219
peek displayhundred, b1
b0 = $02
gosub send_data_7219
peek displaythousand, b1
b0 = $01
gosub send_data_7219
end_show_display:
return
send_data_7219:
'send the data
low LOAD_7219
pin7 = bit7
pulsout clk_7219, 1
pin7 = bit6
pulsout clk_7219, 1
pin7 = bit5
pulsout clk_7219, 1
pin7 = bit4
pulsout clk_7219, 1
pin7 = bit3
pulsout clk_7219, 1
pin7 = bit2
pulsout clk_7219, 1
pin7 = bit1
pulsout clk_7219, 1
pin7 = bit0
pulsout clk_7219, 1
pin7 = bit15
pulsout clk_7219, 1
pin7 = bit14
pulsout clk_7219, 1
pin7 = bit13
pulsout clk_7219, 1
pin7 = bit12
pulsout clk_7219, 1
pin7 = bit11
pulsout clk_7219, 1
pin7 = bit10
pulsout clk_7219, 1
pin7 = bit9
pulsout clk_7219, 1
pin7 = bit8
pulsout clk_7219, 1
high load_7219
return
Any pointers on how to isolate my problem would be appreciated.
Thanks
Tim
I would appreciate some troubleshooting suggestions.
I am having a challenge with getting a MAX7219 to run 4 CC 7 segment display digits.
I have all of the segments joined on a bus and with the cathodes grounded, +5 to any segment on the bus lights up the segment on all 4 displays.
The bus is wired to each of the corresponding segments on the 7219.
I am using digit0 to digit 3 on the input side of the 7219. DIN, CLK and Load are tied low with 10K resistors. I have a 10K resistor from pin 18 to pin 19 for the ISET line.
From my 28x, Output 7 feeds the data to DIN. Output 6 provides the Load and Output 5 takes care of the clock.
I can see my outputs with debug on as I have leds on every output. From what I can see, the software is operating properly.
My thanks to MartinM for the code. I stripped down the tach / advance code that he had posted here in the forum. I have tried a couple other samples but this one clearly demonstrated to me how the bits get moved out of the 28x.
I can't seem to get any sign of life to the 7 segment displays. I have the 7219 data sheet pretty much memorized and I can see when the code enters the "test Digit". Nothing lights up, - ever.
I have replaced the 7219 in the event that it might have been the problem, but still no luck.
The code is here:
'28x
'7219 version 4
symbol displaythousand = $c0
symbol displayhundred = $c1
symbol displayten = $c2
symbol displayunit = $c3
'7 segment multiplexing
symbol load_7219 = 6
symbol din_7219 = 7
symbol clk_7219 = 5
'blank value for display
symbol display_blank = $0F
'max7219 registers
symbol decode_mode = $09
symbol intensity = $0A
symbol scan_limit = $0B
symbol shutdown = $0C
symbol digit_test = $0F
start:
poke displaythousand, display_blank
poke displayhundred, display_blank
poke displayten, display_blank
poke displayunit, display_blank
'initialize 7219
gosub initialize_7219
'turn on test mode
b0 = digit_test
b1 = $01
gosub send_data_7219
pause 1000
'turn off test
b0 = digit_test
b1 = $00
gosub send_data_7219
end_start:
'set displays zero
poke displaythousand, 0
poke displayhundred, 0
poke displayten, 0
poke displayunit, 0
gosub show_display
Main:
w6 = 82
w6 = w6*60
b0 = w6 / 1000
poke displaythousand, b0
b0 = w6 // 1000 / 100
poke displayhundred, b0
b0 = w6 // 100 / 10
poke displayten, b0
b0 = w6 // 10
poke displayunit, b0
gosub show_display
goto main
end
initialize_7219:
b0 = decode_mode
b1 = $FF ' code b decode all digits
gosub send_data_7219
b0 = intensity
b1 = $0F
gosub send_data_7219
b0 = scan_limit
b1 = $03
gosub send_data_7219
b0 = shutdown
b1 = $01
gosub send_data_7219
return
show_display:
peek displayunit, b1
b0 = $04
gosub send_data_7219
peek displayten, b1
b0 = $03
gosub send_data_7219
peek displayhundred, b1
b0 = $02
gosub send_data_7219
peek displaythousand, b1
b0 = $01
gosub send_data_7219
end_show_display:
return
send_data_7219:
'send the data
low LOAD_7219
pin7 = bit7
pulsout clk_7219, 1
pin7 = bit6
pulsout clk_7219, 1
pin7 = bit5
pulsout clk_7219, 1
pin7 = bit4
pulsout clk_7219, 1
pin7 = bit3
pulsout clk_7219, 1
pin7 = bit2
pulsout clk_7219, 1
pin7 = bit1
pulsout clk_7219, 1
pin7 = bit0
pulsout clk_7219, 1
pin7 = bit15
pulsout clk_7219, 1
pin7 = bit14
pulsout clk_7219, 1
pin7 = bit13
pulsout clk_7219, 1
pin7 = bit12
pulsout clk_7219, 1
pin7 = bit11
pulsout clk_7219, 1
pin7 = bit10
pulsout clk_7219, 1
pin7 = bit9
pulsout clk_7219, 1
pin7 = bit8
pulsout clk_7219, 1
high load_7219
return
Any pointers on how to isolate my problem would be appreciated.
Thanks
Tim