PDA

View Full Version : Max7219 cascading problem ?



iugmoh
- 25th February 2008, 20:26
Hi everyone,
thanks for every one helping me in this forum which it's my favourite forum to achive and nearly reached to the end of my first project ( queueing system ) , but I have some explanation about cascading max7219 .

In this project I can control up to 18 large seven segments with using only 3 Max7219 and 3 UDN2981 , where each 3 digits are together in same connection , and every 6 digits are connected to max7219 . but the problem is when I display any number on first 3 digits then the same number displayed on the 3 digits on the next max7219 , but I can avoid this by displaying the required number again in the 3 digits which changed by wrong. I solve it but I need a prefect solution with needing to change the other digits .

here is my code

''''''' Initial MAX7219
Init_MAX:
;-----the first , MAX7219 SETUP-----
ADDRESS = $09 : DATAREG = $FF : gosub send_data'decode mode Code B-digits 7-0
ADDRESS = $0A : DATAREG = $0f : gosub send_data'intensity (brightness) 0..15
ADDRESS = $0B : DATAREG = $05 : gosub send_data'scan limit 0..5
ADDRESS = $0C : DATAREG = $01 : gosub send_data'normal operation
ADDRESS = $00 : DATAREG = $ff : gosub send_data'no test
ADDRESS = $0F : DATAREG = $00 : gosub send_data'display normal format

;-----the second ,MAX7219 SETUP-----
ADDRESS = $09 : DATAREG = $FF : gosub send_data1'decode mode Code B-digits 7-0
ADDRESS = $0A : DATAREG = $0f : gosub send_data1'intensity (brightness) 0..15
ADDRESS = $0B : DATAREG = $05 : gosub send_data1'scan limit 0..5
ADDRESS = $0C : DATAREG = $01 : gosub send_data1'normal operation
ADDRESS = $00 : DATAREG = $ff : gosub send_data1'no test
ADDRESS = $0F : DATAREG = $00 : gosub send_data1'display normal format

;-----the third ,MAX7219 SETUP-----
ADDRESS = $09 : DATAREG = $FF : gosub send_data2'decode mode Code B-digits 7-0
ADDRESS = $0A : DATAREG = $0f : gosub send_data2'intensity (brightness) 0..15
ADDRESS = $0B : DATAREG = $05 : gosub send_data2'scan limit 0..5
ADDRESS = $0C : DATAREG = $01 : gosub send_data2'normal operation
ADDRESS = $00 : DATAREG = $ff : gosub send_data2'no test
ADDRESS = $0F : DATAREG = $00 : gosub send_data2'display normal format


return

send_data:
'''''send data to max7219
load=0
SHIFTOUT DIN,CLK,1,[ADDRESS,DATAREG\8]
'SHIFTOUT DIN,CLK,1,[ADDRESS]
'SHIFTOUT DIN,CLK,1,[DATAREG]
load=1
PAUSE 20
return

send_data1:
''''''send data to max7219
load=0
SHIFTOUT DIN,CLK,1,[ADDRESS,DATAREG\8,0,0] ; two nop code
load=1
PAUSE 20
;PULSOUT LOAD,1 ' basicly just selects or deselect the max7219
return

send_data2:
''''''send data to max7219
load=0
SHIFTOUT DIN,CLK,1,[ADDRESS,DATAREG\8,0,0,0,0] ; two nop code
load=1
PAUSE 30
;PULSOUT LOAD,1 ' basicly just selects or deselect the max7219
return

iugmoh
- 28th February 2008, 18:26
Ok I found the solution in APPLICATION NOTE 3947
Daisy-Chaining SPI Devices, after no respone form any other

CuriousOne
- 13th December 2020, 10:53
Having the same issue, I don't think OP is active anymore but...