I’ve been using the ATMega 328p and MAX7219 combo on several projects with great satisfaction. However, my latest project has brought me to a full stop.
Most of my setups are pretty simple: 1 ATMega 328p + 1 MAX7219 + a bunch of LEDs or 7 segments. I like designing my own PCBs so I tend to minimize the ATMega’s setup to the processor, 2 capacitors and the reset resistor. In that case, I run it on the internal oscillator. To program it, I use Nick Gammon’s board programmer with Arduino ISP.
My latest project is a simple clock based on a DS3231 RTC module with 1 ATMega 328 and 4 MAX7219 driving 7 segments displays as well as the analogic seconds display. When I’ve started soldering and testing the PCB I designed, I noticed that after a few minutes, the digits start flickering like crazy or the program simply resets, or it hangs.
The breadboard setup I have for this project has: - 1 standalone ATMega328p @8MHz - 6 MAX7219 drivers on eBay “tube” or “matrix” modules (2 of them unused on a 3-chain) - 4 distinct LedControl libraries
The production PCB has: - 1 ATMega328p @8MHz - 4 separate MAX7219 drivers, 3 of them in a chain - 2 distinct LedControl libraries
As I’ve read on this forum that cheap MAX7219 I get off eBay are not that good with chains and long wires, I’ve made the wires as short as possible. To be honest, I had a lot of trouble pin-pointing that on the breadboard setup and I’ve spent days looking at faulty displays (only 1 digit in 8 lighting up, for instance).
Now, on the production board, I’m wondering whether the internal oscillator of the processor may be at fault and I should have run it at 16Mhz with a crystal. On the breadboard setup it works fine (with no chain) and on one of my other projects I have 5 MAX7219 in a chain working fine but with an ATMega328p @16Mhz with an external oscillator.
I’m at a loss here, do you have any ideas? Of course, I’ll provide you with any additional details if needed.