0

I have an issue quite similar to this one. The behavior of my MAX7221 is the following:

  1. when powering on the board the first time (let's from cold & dark) it turn on all the segments and does not respond to any SPI command
  2. turning off and on the power supply leads to the correct behavior
  3. turning off the power supply, short-circuit V+ with GND, and turning on leads to the same behavior of point 1.

Here my schematic:

MAX7221

Other information:

  • I checked the source of the IC: Mouser
  • I tried with different SPI clock speeds: it changes nothing. When it works, it works always. When it hangs on power on, it does not respond until a power cycle.
  • I tried with different C51 values: it changes nothing. From 0 pF to 2200 uF the behavior is exactly the same. On the 5V rail I only have another 10 uF placed close the power supply and a bunch of 100 nF placed close the other ICs.
  • the datasheet says: "Display Blanked on Power-Up" but this is not true. Even when it works correctly, on power up it shows some random segments on. Anyway, I can issue the SPI commands to turn them off.

Because after a power cycling it works fine, I bet there is something about the capacitors. Because the MAX7221 does not have a reset pin, the only idea that comes to mind is to add a power switch to turn it on after a while... but I wonder if there is a more elegant solution.

Mark
  • 1,161
  • 6
  • 23
  • 2
    Do you have a scope? Can you check the SPI lines after the level translator? (Between TXB0106 and MAX7221) TXB series has a few quirks IIRC. – Wesley Lee May 14 '21 at 15:21
  • How is it powered and what 3.3V device controls it? – Justme May 14 '21 at 15:33
  • 1
    How are you driving the SPI bus? Is controller there power cycled too? All segments enabled is "display test" feature of the MAX7221 which is enabled by clocking in 16 or more high bits to DIN. Note that (from DS): "The MAX7219/MAX7221 remain in display-test mode (all LEDs on) until the display-test register is reconfigured for normal operation." so it would seemingly not respond to other commands. – Martin May 14 '21 at 15:50
  • @Justme, 3.3V is provided by a common 1117-3.3 and the device is an xmega – Mark May 14 '21 at 16:04
  • @WesleyLee, yes I checked and the signals are good even when the MAX7221 hangs – Mark May 14 '21 at 16:05
  • 1
    SPI signals would be interesting just after power-up to see if there are no spurious clock/CS cycles with DIN high. Or you need to provide more details on your xmega part of the circuit. Maybe the easiest way to find out if test-mode is what happens would be to explicitely send test-mode off (0xff 0x00) when device seems to be "stuck". – Martin May 14 '21 at 16:09
  • @Martin, good shot. I'm going to check this. – Mark May 14 '21 at 16:14
  • What is the first message that you send at power up? – HandyHowie May 14 '21 at 16:45
  • I am suspicious of that auto-direction level translator. Try probing the signals on either side of the translator. – Spehro Pefhany May 14 '21 at 17:02
  • @Martin, you were right. It enters in test mode. Settings the register to 0x00 recovers the functionality! – Mark May 14 '21 at 18:22
  • @Mark nice, but the next step would be to figure out why it happens, and why only after "cold" start. Showing scope traces should help. Because there is only a few significant bits in the command and all are "1", I would suspect either clock going in with invalid DIN (level shifter issue?) or a some issue/race condition in SPI signals timing. Or maybe xmega code error? – Martin May 14 '21 at 19:11

1 Answers1

1

Partial answer, so it won't get lost in comments.

The reason for MAX7221 (seemingly) not responding to any command is the "Display Test" mode. this mode is activated by 0xF command with data LSB set to one. Because other bits are insignificant, it can be enabled by clocking in 16 "1" bits (that is DIN constant high) for example or possibly by some of-by-one error or race condition while sending other command.

In the display test mode all other control (including shutdown mode) is overridden and all segments are permanently enabled regardless of any setting. Received commands will still affect internal state/data in the chip, but not display output.

From the datasheet:

Display-Test Register

The display-test register operates in two modes: normal and display test. Display-test mode turns all LEDs on by overriding, but not altering, all controls and digit registers (including the shutdown register). In display-test mode, 8 digits are scanned and the duty cycle is 31/32 (15/16 for MAX7221).

The MAX7219/MAX7221 remain in display-test mode (all LEDs on) until the display-test register is reconfigured for normal operation.

What exactly causes enabling the test mode after "cold" start is unclear without providing more details about SPI bus controller and behavior under start-up.

Martin
  • 1,054
  • 5
  • 10
  • I'm going to check the SPI signals on power up. If I find useful information I'll update my question. – Mark May 14 '21 at 20:01