In the max7219_put function, the load line should be set LOW to begin, not HIGH. this is not strictly necessary for the 7219, only the 7221. But it is technically wrong regardless. ["For the MAX7219, serial data ... is shifted ... with each rising edge of CLK regardless of the state of LOAD. For the MAX7221, CS [LOAD] must be low to clock data in or out."]

 

void max7219_put(byte reg, byte data)
{
  max7219_setLoad(LOW);  // begin    ** in the example this is HIGH, which is wrong! ** 
  max7219_putByte(reg);  // specify register
  max7219_putByte(data); // put data
  max7219_setLoad(LOW);  // latch in data
  max7219_setLoad(HIGH); // end
}

Eric F.

Share