MAX7219 and over clocking
Discussion in "8051 Discussion Forum" started by jona Aug 4, 2024.
Sun Aug 04 2024, 01:18 pm
I recently started playing with smd MAX7219 8x8 LED modules. I arrange four horizontal four-in-one modules in a square 32x32 LED matrix, with the five input pins coming off the right end of the top four-in-one module. Now, because I rotated the modules 90 degrees, what were columns become rows. I noticed that the 10uF capacitor is not included on each module, so I added one to each module, a total of 16 caps. I used a 12mHz crystal on my AT89S52 minimum system board.
My program first sets up the control registers, then repeats the following: display a blank screen, then scrolls down a smiley face from the top, pausing when the full face is displayed to blink one of the eyes, followed by the face scrolling down until a blank screen. Repeat.
Two problem types arose. Various 8x8 modules near the end of the chain will either go blank altogether, or only the first row (nee column) displays extra bright. I attribute this behavior to corruption of the shutdown and scan limit control registers, respectively. I confirmed my suspicion by putting a detour in the program that repeats the portions of code that initializes those two registers. That detour is invoked by pulling low an otherwise unused pin on the AT89S52. After invoking that detour the affected modules go back to normal operation.
The other problem type is the middle six LEDs (as if 7Eh were sent to that module) in a row are turned permanently on. They do not scroll. The detour described in the preceding paragraph does not clear up this problem.
A posting at
https://www.edaboard.com/threads/about-at89s52-24pc-crystal-oscillator-frequency.178905/
described using a 48mHz active crystal, so I tried one, with slight modification to the board. I made no changes to the program, and now the two types of problems described above are gone. However, a new problem arose: the display will freeze, and then in a short time continue as if nothing happened. I felt that the AT89S52 was getting warm so I attached a heat sink and a small fan, and that new problem disappeared.
Any insights on why over clocking the AT89S52 with an active crystal would fix the problems?
My program first sets up the control registers, then repeats the following: display a blank screen, then scrolls down a smiley face from the top, pausing when the full face is displayed to blink one of the eyes, followed by the face scrolling down until a blank screen. Repeat.
Two problem types arose. Various 8x8 modules near the end of the chain will either go blank altogether, or only the first row (nee column) displays extra bright. I attribute this behavior to corruption of the shutdown and scan limit control registers, respectively. I confirmed my suspicion by putting a detour in the program that repeats the portions of code that initializes those two registers. That detour is invoked by pulling low an otherwise unused pin on the AT89S52. After invoking that detour the affected modules go back to normal operation.
The other problem type is the middle six LEDs (as if 7Eh were sent to that module) in a row are turned permanently on. They do not scroll. The detour described in the preceding paragraph does not clear up this problem.
A posting at
https://www.edaboard.com/threads/about-at89s52-24pc-crystal-oscillator-frequency.178905/
described using a 48mHz active crystal, so I tried one, with slight modification to the board. I made no changes to the program, and now the two types of problems described above are gone. However, a new problem arose: the display will freeze, and then in a short time continue as if nothing happened. I felt that the AT89S52 was getting warm so I attached a heat sink and a small fan, and that new problem disappeared.
Any insights on why over clocking the AT89S52 with an active crystal would fix the problems?
Powered by e107 Forum System