-2

What is the exact meaning of the Initial Power-Up Section of the MAX7219 data sheet to be found on Page 7?

It says:

On initial power-up, all control registers are reset, the display is blanked, and the MAX7219/MAX7221 enter shutdown mode. Program the display driver prior to display use. Otherwise, it will initially be set to scan one digit, it will not decode data in the data registers, and the intensity register will be set to its minimum value.

Most of this is clear. But specifically, what does the "the display is blanked" mean? Does it mean that the MAX7219 internal SRAM is cleared as part of the power-up sequence or does it mean that because the display is set to shutdown mode by power-up the display will be blank.

I have sought widely and cannot find a definitive statement. Which of these interpretations is correct, or perhaps is there another interpretation?

Why does it matter? Idle curiosity really. My read of the datasheet was that the RAM was cleared and hence did not expect to have to manually clear it.

So I didn't, and was wondering where the flash of random data at power up in my bank of displays was coming from, prior to the first display data write. And I was a bit too slow in accepting I got reading the datasheet wrong, or the datasheet didn't apply to the clone I was using.

I was wondering if someone had a definitive answer from some deep investigation or perhaps insider information. It seems not, and it may not be consistent anyway.

For the clone MAX7219s in my collection, the SRAM is not cleared on power-up. I don't know if that is the case for genuine MAX7219 or for different clones for that matter. In future, I will just assume not and zero out the SRAM manually.

That point about a pull-up resistor on the chip select(CS) line to mitigate erratic behaviour is an excellent one. Random noise here can easily generate unexpected results.

It should be noted though that if the CS line is not the default Slave Select (SS) of the SPI pin group, it is not enough to use a pull-up resistor alone.

The SPI begin function takes care of the case that the default SS pin will glitch low as it is made an output if the corresponding bit in the output register is not set to 1 prior to setting the pin to output mode.

For the default SS pin, begin() does a digitalWrite HIGH first, setting the internal pullup resistor on (and the output register bit to 1) then a pinMode to OUTPUT, thus if the SS pin is already pulled high by a resistor there are no glitches.

However, if the CS pin is a pin other than the designated SS, then the same process must be undertaken by user code. If forgotten, even a pulled up pin will glitch low as the output register, with the bit set to 0, is transferred through to the pin when it is configured as output.

It is easily fixed using the same method as the SPI library uses, digitalWrite a HIGH to the CS pin, then set that pin to OUTPUT. And pull it up, of course.

  • I'm a little confused. There doesn't appear to be any way for you read the RAM in the the device. So if there were a distinction between the display being blanked and the RAM being cleared (I suspect there isn't) how would you observe that or why would you care? Your question as written is probably better suited to ESE. – timemage Jan 23 '23 at 03:53
  • If the mechanism is not described in the datasheet then it will be difficult to determine how the blanking is achieved and may even differ between various clones / fakes. However, if you are asking because you have experienced erratic/random behaviour at system start then putting a 10k pullup resistor on the load/cs pin may help. – 6v6gt Jan 23 '23 at 03:53
  • You've edited your initial post extensively so it is not now clear if there is an issue remaining. However, the point about the external pullup resistor on the load/cs pin is that it minimises the risk of instability at system start, to which these MAX7219 chips are prone, while the MCU pins are still floating. That is, before the internal pullup has been activated. – 6v6gt Jan 24 '23 at 07:21

1 Answers1

-1

I think it's pretty clear from the datasheet.

all control registers are reset

The digit displays are registers, and therefore they will contain zeroes.

Displaying one digit, being in shutdown mode, and minimum intensity are all what would happen if all registers were set to zero.

I have sought widely and cannot find a definitive statement.

Why is this important to know? When powered on it will be blank, as stated. Presumably you will configure it to the way you want it before leaving shutdown mode.

Nick Gammon
  • 35,792
  • 12
  • 63
  • 121
  • 1
    the datasheet contains the phrase `Table 2 lists the 14 addressable digit and control registers.` ... it is unclear if `all control registers are reset` includes the digit registers ... like you said, does it really matter? – jsotola Jan 23 '23 at 08:25