max 7219 not giving serial out data
Discussion in "8051 Discussion Forum" started by [email protected] Oct 5, 2019.
Sat Oct 19 2019, 02:48 am
Hopefully you understand some of the program.
Which parts don't you understand ?
Which parts don't you understand ?
Sun Oct 20 2019, 12:43 am
please find video attachment. 3rd & 4th display flickering, and not scroll in their order, like 1 dotmatrix to 4.
Sun Oct 20 2019, 08:23 pm
sir, when i on display ,sometime 3rd display is not refreshing, i again switch off display, then it refresh.
Sun Oct 20 2019, 08:32 pm
sir, when i on display ,sometime 3rd display is not refreshing, i again switch off display, then it refresh.
[ Edited Sun Oct 20 2019, 08:33 pm ]
Mon Oct 21 2019, 02:48 pm
I’ve been following this thread and looking at the example code and checking the MAX7219 datasheet. The code made sense and looked like it should work and I was ready to conclude some sort of hardware / timing problem between displays 2 and 3 when suddenly it clicked.
With four displays linked together data is effectively being clocked into a 64 bit shift register.
First 16 bits of DATA are sent then LOAD is strobed so the data is loaded into display #1.
Next 32 bits are sent (16=DATA, 16=NOP) and LOAD is strobed. The data is loaded into display #2 and display #1 gets nop.
However the original 16 bits for display #1 get shifted down the chain into display #3 so display #3 gets loaded with the display #1 data. It will briefly show a copy of display #1 until the actual display #3 data is sent which is why it flickers.
Data clocked into the shift register is not cleared after a LOAD pulse so 64 bits must always be sent to ensure all displays get loaded with NOP except for the selected display.
Something like:
With four displays linked together data is effectively being clocked into a 64 bit shift register.
First 16 bits of DATA are sent then LOAD is strobed so the data is loaded into display #1.
Next 32 bits are sent (16=DATA, 16=NOP) and LOAD is strobed. The data is loaded into display #2 and display #1 gets nop.
However the original 16 bits for display #1 get shifted down the chain into display #3 so display #3 gets loaded with the display #1 data. It will briefly show a copy of display #1 until the actual display #3 data is sent which is why it flickers.
Data clocked into the shift register is not cleared after a LOAD pulse so 64 bits must always be sent to ensure all displays get loaded with NOP except for the selected display.
Something like:
Send16: for x=4 to 1 if x == displayNumber SendDATA else SendNOP
[ Edited Tue Oct 22 2019, 06:12 pm ]
Tue Oct 22 2019, 10:48 am
Thanks for support,
Thanks.
After Wimac's suggestion, I made a few changes.
Try this..
Powered by e107 Forum System