Hi all,
I'm making a 7 segment display array using 100 x 4 digit, 7 segment displays and 50 x MAX7219 chips.
The first ~60 displays (30 chips) were working great. I then soldered another 20 displays (10 chips) and the data the chips are getting towards the end of the daisy chain are becoming almost random. Sometimes all the displays will work for a short bit as intended, and then sometimes displays will turn on and off at random, change brightness, display weird things etc. (see video).
I've been working on this project for awhile now (this is the 4th iteration of the PCB design!) and I've managed to solve all of the other issues I've run into but this one has me stumped.
My initial thoughts are that there is some sort of interference(?) or something causing this randomness. I've attached a short video of me turning it on and off a couple times, as well as the schematic and the test code I'm running.
Thank you and all help appreciated.
#include <SPI.h>
// What pin on the Arduino connects to the LOAD/CS pin on the MAX7219/MAX7221
#define LOAD_PIN 10
void maxTransfer(uint8_t address, uint8_t value) {
digitalWrite(LOAD_PIN, LOW);
for (uint8_t i = 0; i < 40; ++i)
{
SPI.transfer(address);
SPI.transfer(value);
}
digitalWrite(LOAD_PIN, HIGH);
}
void setup() {
// Set load pin to output
pinMode(LOAD_PIN, OUTPUT);
// Reverse the SPI transfer to send the MSB first
SPI.setBitOrder(MSBFIRST);
// Start SPI
SPI.begin();
// Run test
// All LED segments should light up
// maxTransfer(0x0F, 0x01);
// delay(3000);
// maxTransfer(0x0F, 0x00);
// Enable mode B
maxTransfer(0x09, 0xFF);
// Use lowest intensity
maxTransfer(0x0A, 0x00);
// Only scan one digit
maxTransfer(0x0B, 0x07);
// Turn on chip
maxTransfer(0x0C, 0x01);
}
void loop() {
// Loop through each code
for (uint8_t i = 0; i < 0x10; ++i)
{
maxTransfer(0x01, i);
maxTransfer(0x02, i);
maxTransfer(0x03, i);
maxTransfer(0x04, i);
maxTransfer(0x05, i);
maxTransfer(0x06, i);
maxTransfer(0x07, i);
maxTransfer(0x08, i);
delay(1000);
}
}
[7SDA (ATMEGA328P).pdf|attachment](upload://xDPB0vnVzxiI4b09x7ug7zd9MHg.pdf) (3.7 MB)
7SDA (ATMEGA328P).pdf (3.7 MB)




