MAX7219 doesn't initialize properly at power-on

Hi,
I have a Wemos D1 driving three MAX7219 7-segment displays on separate CS lines from the Wemos. The displays show three values from Home Assistant (2023.1.5) related to electricity price and consumption

All works well except for the first boot after power-cycle when the displays stay blank. Checking Home Assistant I see the D1 connects and values are sent. The display_brightness is restored to the previous setting as well. Rebooting the device either through the RESET button or through a restart_button brings the display back to life.

I now have an automation in HA waiting for the device to power on and connect, then call button.press service on the device’s reset button.

Can I to do anything else to get the displays to work at boot without the work-around?

/Mattias

button:
  - platform: restart
    name: "Restart"

spi:
  clk_pin: D0
  mosi_pin: D5

number:
  - platform: template
    id: max7219_bright
    name: "Display brightness"
    optimistic: true
    restore_value: True
    initial_value: 5
    step: 1
    min_value: 1
    max_value: 15

display:
  - platform: max7219
    cs_pin: D6
    num_chips: 1
    lambda: |-
      it.printf("Pr%7.2f", id(cost).state);
      it.set_intensity(id(max7219_bright).state);
  - platform: max7219
    cs_pin: D7
    num_chips: 1
    lambda: |-    
      it.printf("En%7.2f", id(energy).state);
      it.set_intensity(id(max7219_bright).state);
  - platform: max7219
    cs_pin: D2
    num_chips: 1
    lambda: |-
      it.printf("Sun%6.2f", id(prod).state);
      it.set_intensity(id(max7219_bright).state);


sensor:
  - platform: homeassistant
    name: "cost"
    id: cost
    entity_id: sensor.energy_huset_cost
  - platform: homeassistant
    name: "energy"
    id: energy
    entity_id: sensor.energy_huset
  - platform: homeassistant
    name: "Prod"
    id: prod
    entity_id: sensor.solaredge_energy_today_kwh
1 Like

Anything interesting in the Verbose logs? They might be hard to catch after a power cycle I guess…

I wonder if it could be a power issue? Maybe on power cycle there is a power demand spike and not enough for proper set-up of your displays? I heard capacitors can be charging etc.

Does it happen if you just have one display connected with minimal brightness and a good quality power supply?

If you are daisy chaining them maybe the voltage drop is too high?

From docs

You can even daisy-chain multiple MAX7219s by connecting the DOUT of the previous chip in the chain to the next DIN. With more than ~3 chips the 3.3V will probably not be enough, so then you will have to potentially use a logic level converted.

Are you powering them from 3v3? Tried 5v?

Thanks for the feedback!
Power supply was the issue for some reason (it’s been working on 3.3V from the D1 since this summer). I connected the displays (MAX7219 LED module 8 Bit 7 segment display LED display for Raspberry Pi – AZ-Delivery) to 5V instead and now all works.