#MAX7219 7-segment display troubles with Mobiflight v10

1 messages · Page 1 of 1 (latest)

frozen zealot
#

Hi everyone. I’m new here and can’t get my 7 segment display to function with MF (now updated to v10). I have been troubleshooting for over a week and am beginning to lose my mind over this!

I recently built a Nav/Com radio using 4 daisy chained displays. They are connected to a clone of an Arduino Mega which is being powered by a mains PSU. When I first fired up MF, all 4 displays lit up and successfully displayed test digits (123.456) as expected. Next time I plugged it in it didn’t work and it has never worked since. Now the displays light up but won’t display anything in MF test mode (I don’t have a sim connected at this point but I have tried it with MSFS and it still doesn’t work).

The really strange thing is I have just bought a fresh pack of MAX7219 units and am connecting them one by one in order to rule out problems with my wiring or the original units. MF still cannot display any digits in test mode.

I have checked my soldering; checked the connections to the Arduino; checked DIN, CS, CLK settings in MF; updated firmware; tried 5 new displays independently. Despite all this, I still can’t get MF to display anything.

Really sorry about the long post! I hope someone might be able to point me in the right direction as I’m all out of ideas 🤯

trail imp
#

how are you powering the displays

#

also post a screenshot of your module config dialog showing the configuration for the displays, and a screenshot of the output config for the displays

late sky
#

5v supply should go in parallel to each Max7219 module.

worldly geode
#

I say - the builder must have - 1 test arduino (for example, nano) and use the ino file to test the functionality of the MAX7219 module to rule out problems in the connection of MF and MAX7219

crimson patrol
#

@worldly geode no MobiFlight user should have to deal with .ino-files - that's my opinion and my goal for MobiFlight

#

Typically the problem as described by the user can be linked to an issue with the power supply to the chained modules

manic fern
#

Not to butt in here, but I had the same problem a few months ago. My solution was to configure each display with it's own set of pins and was doing great until 10. Not a wiring issue but a config issue.

late sky
#

unfortunately, that only works if you use 4 displays max.

frozen zealot
#

Wow, what a friendly forum - thanks everyone. Here are some pics to illustrate my current basic test with only one module, for simplicity. MF test function does not change the display …

trail imp
#

Thanks for the info. For future screenshots you can use WIN+SHIFT+S to get crosshairs to grab the screen directly then can paste in discord, makes it easier for us to read the text

#

power and ground are coming from the arduino?

frozen zealot
#

OK, will do. The D1 capacitor has been removed and bridged to prevent voltage drop.

#

Yes, power and ground from Arduino

trail imp
#

ok, for one display should be fine. lemme peer at your configs, see if I see anything. @late sky is good at that too, maybe he sees something

#

first thing I would try is setting the number of digits to 8 instead of 6 in your output, and enable all eight of them

frozen zealot
#

Tried that but no different

trail imp
#

I think your wires are connected to the wrong end of the boards

#

if it's like mine, the left side is output, the right side is input

frozen zealot
#

I have already tried switching ends but the result is identical

trail imp
#

in your photo the wires are definitely connected to the wrong end if the silkscreen says DOUT on it

frozen zealot
#

In the photo, yes. But I have tried both ends many times

trail imp
#

ok, well, for us to continue helping you need to connect them to the other side and post new photos so we can see which wires are connected to the pins and trace them back to the arduino

worldly geode
frozen zealot
#

Ok, this is a different max module, wired at the ‘in’ end. Settings in MF are same as in previous photos but the test still doesn’t work.
Thanks again

late sky
#

did you power cycle the board and restart Mobiflight before this test?

#

I see there is a barrel jack connection made... what voltage is supplied throught the barrel jack? For this test this connection is not required, as the usb can supply enough current for one module.

frozen zealot
#

I did cycle and re-start. The PSU may be too high (9v) but the results are the same when using USB only.

trail imp
#

Can you post a screenshot of the output config again as it is currently configured?

late sky
#

7 segment displays I think can take up to 5.5v.

#

I suggest taking off the 9v barrel jack connection and power only from usb.

#

make sure the 5v supply to the module is not over 5.5v

wanton hawk
#

max is blank on the photo

wanton hawk
trail imp
#

Mine

#

showing the right pins to use

wanton hawk
#

oh that is something else

#

right

#

but yeah

#

some of those MAX modules seem to be really bad batches - I suggest you try each one separately at first to see if they even work as one module connected, there have been reports from some purchases where a lot fo them never really work

late sky
#

yeah, we can't discard that the module may now be faulty, even if it worked the first time. Maybe load a test sketch just to discard that Mobiflight is at any fault here. Frankly, I don't see anything wrong with the wiring in the pictures other than them being Dupont wires (I use Dupont wires on mine) but they are known to cause problems.

frozen zealot
#

Thanks everyone. I need to be elsewhere for a few hours but will post new pics when I can.

crimson patrol
late sky
#

I thought the same, but at least they seem ok in the pictures.

wanton hawk
#

yeah the colors seem to match

#

unless one of the cables is bad

#

but the 8.8.8.8.8.8.8.8. gives a vibe of a wiring problem

#

but it could of course be a faulty chip too

late sky
#

I don't know for sure, but removing the diode to power the board in reverse is not a good idea in my book.

#

I mean, you were doing exactly what the diode was installed to prevent.

frozen zealot
#

I read online that the diode should be removed if daisy chaining units, which is why I tried that. However, the unit shown in the latest pic does not have the diode removed.

#

Here’s the strange thing - the original full unit when first plugged into MF, did this …

#

Since then, I haven’t got a single unit to work with MF

#

As for the many 8s, the units display those with just VCC and Ground connected. So that’s probably not an indicator that the signal cables are wrong.

#

I am starting to think those who have suggested the units are all faulty might be right.

late sky
#

I think you misinterpret the recommendation to remove the diode.

#

The diode has a 0.7v drop but is there to protect each board from reverse polarity or feeding it in reverse.

crimson patrol
#

i second what Jaime says and I never liked the recommendation given by some here to remove the diode

late sky
#

The voltage drop makes the voltage unusable by the third board in a chain.

#

That is why we recommend wiring the 5v in parallel instead of removing the diode.

#

But all this is all on the basis of feeding the power forward, not backwards

crimson patrol
#

it made it more convenient because you can daisy chain them easier but it comes with the risk that you connect them incorrectly and damage the chip

wanton hawk
#

you can daisy chain the powers from the IN edge

#

before the diode

crimson patrol
#

i have had hundreds of max chips green or blue modules - the green ones are very stable and rarely have issues. The blue ones need proper inspection - there were batches with many faulty ones.

frozen zealot
#

I see, fair enough. I have only removed diodes on 2 of my 10 units so I’ll stop doing that now. It was a last resort as I had already tried wiring 5v in parallel but MF was behaving strangely. Units were going on/off randomly.

crimson patrol
#

make sure your usb hub is powered

#

you won't drive many digits just off the USB power from the regular port

wanton hawk
#

also the wires just take interference very easily

#

my single module became stable when I soldered a capacitor to it

frozen zealot
#

Yes, I read that so have ordered some capacitors which should apparently solve interference. I’m not convinced it will solve my connection issues though.

crimson patrol
#

those are typically not needed

#

only if you have pots connected to the mega - then you want those

frozen zealot
#

I use a pot for my flaps lever.

crimson patrol
#

at this point it must be something different

#

maybe disconnect the pot

#

you mean on the same arduino?

late sky
#

Yes, 7 segment displays create a lot of noise that is picked up by potentiometers connected on the same board

frozen zealot
#

No, I’m using a separate Arduino for these tests with nothing else connected.

late sky
#

Capacitors are needed to mitigate the noise, but may be difficult to eradicate completely

crimson patrol
#

ok. for troubleshooting max7219 i always say: start with one and then daisy chain later

#

first start with one

#

make sure it works

#

test all individual modules and verify they work

#

then start chaining them and don't forget to update the num of modules in the device config

#

run every vcc directly to each board and all other wires simply daisy chain

frozen zealot
#

Yes, these current tests are all with one. I’ll start over tomorrow and see if I have more luck. Thanks everyone, for your advice.

crimson patrol
#

if you can't get one to work then verify your pins

#

it is 99.9% of the time a pin issue then if you ruled out power

#

and don't forget that the max chip has to be on power all the time, it requires an initialization message from the arduino that only happens when the config is loaded

frozen zealot
#

Hello everyone. I thought I should update this thread as it may help someone facing similar issues in the future. I'm a very happy bunny this evening as I now have a working radio with four 7-segment displays working as they should. However - I tested the original MAX7219s extensively and found the problems were all related to daisy chaining. My soldering wasn't good enough in places. Although everything looked fine to the naked eye, some shorting was occuring between several units' input and output. In addition to that, a couple of the 10 units I bought from Amazon appear to be faulty.

wanton hawk
#

those appear to be the top two common causes

frozen zealot
#

During my tests, I learned that the Arduino needs to be unplugged and reconnected every time a new unit is connected for testing. Also, MF must be closed and re-started. The tracks on the input end of the MAX 7219 are on the top of the unit - I hadn't realised this. It makes them easy to damage/short when soldering. Regarding the full display of 8s, this occurs when the unit cannot initialise due to a power or ground issue.

wanton hawk
#

yeah, the MAX is initialised at the arduino boot

#

so any interruption to the power and it needs a MF restart

frozen zealot
#

Now for the good part - I have solved the problem by reverting to my first NAV/COM radio design which used TM1637 chips. I was sad to discover that MF didn't support those, which is why I made a new design using the MAX 7219. Thanks to the brilliant and generous work of @crimson patrol and all the other devs involved, version 10 of Mobiflight has enabled me to revisit those original chips. I connected them up and they worked perfectly first time! The TM1637 is easier in the sense it cannot be daisy chained so there is less likelihood of damaged connections. It is also a higher quality display in my opinion, and was much cheaper to buy (AliExpress). The only downside is that 4 of these require 8 inputs of the Arduino, but I'm happy to live with that. Thanks again to everyone who has taken the time to help out 😁

wanton hawk
#

nice!

shy kite
#

Sorry guys but I have to chime in because I still see a few suggestions going around that are basically incorrect and likely to be a source of more problems.

The series diodes on the MAX modules should definitely be removed. Even one diode makes the voltage out-of-spec (therefore even just two modules chained are too many).
I understand their purpose for protection makes sense, particularly because they're sold as stand-alone modules for generic usage, and it's certainly useful - but leaving them is not a good choice (let alone if you are chaining modules).
Of course one could exchange the little peace of mind of polarity protection (which should be of no use once the wiring is final) against the roll of dice of out-of-spec operation... to me at least the choice is clear.

If you think you can't do without a polarity protection, at least change the diode with a Schottky type like the 1N5819, which has a lower forward drop - but again, in case of chains, at most one diode on the first unit only.

Of course the recommendation to connect power individually to each module (with suitably thick wires) is also paramount, but I see that at least that is recognized as an established practice.

Regardless of diodes, chaining more than two units on long wiring (but even on a same PCB) is just another gamble.

The 10uF capacitor close to the MAX is not there to let you read cleaner analog values (though of course that's a valid side effect): it's there to buffer local power draw surges. It's not optional.

All of the above measures are mandatory - consider that the MAXes don't exactly have a shining track record for noise tolerance and forgiving operation, even more so for the chinese clones.

#

And for the barrel jack as power source: as long as its voltage is appropriate (up to 9V is fine), it's generally better than using USB power, and at least it's not any worse.

I know that the above comments are usually met with "I have them working for years that way and they are perfectly fine", but suggesting otherwise is a bit like suggesting to cross the road without looking, because you've done it many times and you never got hurt. Besides, the problems that can arise (as well known from the numerous help requests) are most often hard to pinpoint.

wanton hawk
#

Thanks @shy kite

#

good points. I have one pcb with two MAXes that I did myself (a radio panel) and it has never had any problems, but it has the capacitors right next to the MAX, and also the wiring is solid because it is all one circuit board.

When the 10.0 questions about 7segments started to appear I dug out one of those chinese blue pcb 8 digit modules, and I have never had so much trouble to make it work realiably. It is just one, connected with dupont prototype cables just for testing, and I could not even make it work before soldering an extra capacitor on it (the chinese modules do not have the electrolytic capacitor that is specified in the datasheet, it has just those two holes for it, but they likely left it out because it is bulky and cannot be added easily since it is not a surface mount component)

#

Also it just crashes the MAX7219 if I put brightness to max and write the display with "8.8.8.8.8.8.8.8" so all led segments and the decimal points are on, it just fails and needs a restart. So these chinese modules seem to be wildly different in quality.

Just because someone has one that works does not mean all of them really work reliably. This is not even daisy chained, it's just one.

late sky
#

Thank you @shy kite your technical advise is always welcome.

crimson patrol
#

I agree! Thanks GioCC

#

... i know i am the guy who is crossing the street without looking 🤣

late sky
#

@shy kite can I ask for one clarification? You mentioned that even daisy chaining two modules makes the voltage out of spec for the second. I looked at a datasheet that says operating voltage is 4.0v to 5.5v. I understood the diode voltage drop to be 0.7v. If that is true, and the supply voltage is say 4.7v, wouldn't the second module still receive voltage above the minimum spec?

shy kite
# late sky <@462597276754509844> can I ask for one clarification? You mentioned that even d...

@late sky You're as accurate as always, thanks for pointing out. You're right, for some reason I recalled that the MAX had a lower limit of 4.5V, I should have double checked before posting.
I stand corrected, one (silicon) diode would still be fully OK for two modules; even two diodes could work (i.e. each module having its own), but the source must be guaranteed to be 5.5V (and even then IMHO by too low a margin).
(With 4.7V at the source, and both diodes on, the first would be at about 4.0, and the second at 3.3, which is too low.)
However, seriously consider using Schottkys, that would practically solve the problem of having both protection and adequate voltage.

shy kite
wanton hawk
#

yeah, The Arduinos get their own power from USB. The 5V regulator in the Arduino specification is from the times when there were no USB powerbanks and chargers everywhere, so people commonly used 9V batteries to power their arduino projects when not plugged in.

dusty spoke
#

Thanks Tuomas. I think this is an important point for everyone contemplating a build. It's a big misconception that you need to give Mega external power. Only power hungry external devices need external DC supply. Tie GND together always.

wanton hawk
#

yeah this is a long standing thing t hat comes from the old tutorials

#

where you always powered it externally as there was no easy way to get good regulated 5V

#

with usb chargers this has become total non-issue and the onboard 5V regulator is kinda unnecessary even

shy kite
#

Yes and no. First of all, why would you trash the Arduino (albeit a Chinese clone) using DC power? If anything, in case of a (rare) catastrophic failure you are more likely to trash your USB hub, or your PC even, when powered through USB.
Admittedly, where a USB has to be connected for comms, external DC power (to the Arduino) is definitely not required; the barrel jack has always been meant for standalone boards, although it could still be useful to unburden the hub or PC when you have many attached.

#

And as for supplying external modules (bar ofc the very low-power ones) with their own supplies, not through the Arduino, I would call it not the Golden but rather the Platinum rule. This alone would also prevent "frying" your entire household (which would probably amount to just the cheap voltage regulator on the Arduino).

#

If you like, you can easily summarize it all by pointing out that (all) onboard power connectors are there to power the Arduino board, not the entire system.

wanton hawk
#

I think part of the problem with a lot of these diy projects is that you approach this from "I need to get this thing done" angle

#

and not "I want to learn electronics and then make this thing"

#

ie, you kinda learn electronics along the way to get the thing done, and a lot of us are like this, with varying levels of understanding, experience and patience and healthy respect and awareness of things we are not sure about