dont get my MAX 7219 Hardware Display to work

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
Witzman
Posts: 26
Joined: Sun Sep 12, 2021 9:42 am

dont get my MAX 7219 Hardware Display to work

#1 Post by Witzman »

Hi,

i just bought a few MAX7219 Number displays and i have problems getting them to work.

Code: Select all

function displayalt(value)
hw_chr_display_set_text(display_AP_Alt, 1, 1, string.format("%04.00f", value) )
hw_chr_display_set_brightness(display_AP_Alt, 0, 0.5)
end

display_AP_Alt = hw_chr_display_add("AP Alt", "MAX7219", 1)

fsx_variable_subscribe("AUTOPILOT ALTITUDE LOCK VAR", "Feet", displayalt)
The Code above gave me the Display in Airmanager, but the Hardware itself does not respond.
Any ideas?
B84FB91F-C95B-4560-87CD-D519CEBCB3E1.jpeg
D7721341-D638-40ED-A471-F928422EDD29.jpeg
617BE266-9B60-4140-86F7-89C477CED357.jpeg

User avatar
Ralph
Posts: 7926
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#2 Post by Ralph »

Have a look here and you'll probably notice what's going wrong:
http://siminnovations.com/wiki/index.ph ... n_tutorial

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#3 Post by Sling »

Swap your D5 & D6 wires you have them wired backwards.

User avatar
Ralph
Posts: 7926
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#4 Post by Ralph »

And place the hw_chr_display_add above the function.

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#5 Post by Sling »

Thanks to Gilles. He also spotted that the set text function display and character indices start at zero so it should be.

Code: Select all

hw_chr_display_set_text(display_AP_Alt, 0, 0, string.format("%04.00f", value) )

User avatar
Ralph
Posts: 7926
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#6 Post by Ralph »

Yes thank you Gilles! :)

Witzman
Posts: 26
Joined: Sun Sep 12, 2021 9:42 am

Re: dont get my MAX 7219 Hardware Display to work

#7 Post by Witzman »

Thanks for your help, i also got a problem in the solderpoints as well.

Currently i am facing a strange Problem. I created a daisychain of 2 7219 Displays.

This code is not working:

Code: Select all

display_chr_ap = hw_chr_display_add("MAX7219", 2, "ARDUINO_MEGA2560_A_D26", "ARDUINO_MEGA2560_A_D22", "ARDUINO_MEGA2560_A_D24")

function show_dsp(alt, hdg)
    hw_chr_display_set_text(display_chr_ap, 0, 0, string.format("%04.00f", alt) )
    hw_chr_display_set_text(display_chr_ap, 1, 0, string.format("%04.00f", hdg) )
end

fsx_variable_subscribe("AUTOPILOT ALTITUDE LOCK VAR", "Feet", "AUTOPILOT HEADING LOCK DIR", "Degrees", show_dsp)
it only shows me heading on the 2nd display, but no altitude on the first one.

When changing the code like this

Code: Select all

    hw_chr_display_set_text(display_chr_ap, 0, 0, string.format("%04.00f", alt) )
    --hw_chr_display_set_text(display_chr_ap, 1, 0, string.format("%04.00f", hdg) )
   
the altitude is displayed correctly on the first display.

When changing the code like this

Code: Select all

    --hw_chr_display_set_text(display_chr_ap, 0, 0, string.format("%04.00f", alt) )
    hw_chr_display_set_text(display_chr_ap, 1, 0, string.format("%04.00f", hdg) )
   
the heading is displayed correctly on the second display.


What am i missing to display both values at the same time, while they are working for each alone without problems?

Witzman
Posts: 26
Joined: Sun Sep 12, 2021 9:42 am

Re: dont get my MAX 7219 Hardware Display to work

#8 Post by Witzman »

For future reference.
After connecting power&ground to both modules in parallel and only daisychaining the 3 data lines the problem was gone.

User avatar
Ralph
Posts: 7926
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: dont get my MAX 7219 Hardware Display to work

#9 Post by Ralph »

Power issue, strange. I would think it is just forwarded to the next pins, no hocus pocus. But the quality of these displays isn't that great, so maybe not such a big surprise.

User avatar
jph
Posts: 2856
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: dont get my MAX 7219 Hardware Display to work

#10 Post by jph »

Ralph wrote: Fri Oct 15, 2021 6:34 pm Power issue, strange. I would think it is just forwarded to the next pins, no hocus pocus. But the quality of these displays isn't that great, so maybe not such a big surprise.
Ii IS Ralph but even though the displays themselves are good the through tracks are pretty small and the current / hence voltage degrades per module. Always best to power each module from the source and keep the source at least twice what you expect the maximum (I)to be.
I have ended up using a little 'Meanwell' 50W supply for strings of these. - Cheap and guaranteed to give ample power for this and others 5V units - and only about 16 euro delivered. A neat 5V / 10A PSU in a 90 * 90 * 20 mm package. I would caution others about buying ANY SMPU from anywhere that isn't a genuine 'Meanwell' unit. - but that's another story. Great cockpit PSU's :)
Joe
Joe. CISSP, MSc.

Post Reply