Hi,
Here's a quick idea. I dont know if it works timingwise but it may be worth a try. I know you said you tried a FOR-NEXT loop but not how so here goes:
Code:
T Var Byte
i var byte
'Set T to 0 for first chip, 1 for second chip an so on then GOSUB transfer.
Transfer:
ShiftOut Dta,Clk,msbfirst,[Register,R_Val] ' Shift Out the Register first, then the data
If T = 0 then Return 'Send to first chip so we're done
For i = 1 to T
ShiftOut Dta,Clk,1,[0,0] ' Send No-Op Command
Next i
High Load ' Data is now latched in and displayed
@ Nop
Low Load ' Disable the MAX7219
Return
It compiles to about 27% of the original in size and if it works it shouldn't matter how many 7219's you add the code is still the same.
/Henrik Olsson.
Bookmarks