Character Display possible issue.

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Character Display possible issue.

#1 Post by Keith Baxter »

Hi,

AM4.1 beta (29)
Using the MAX7219 and a MEGA. Nothing else connected to the mega.
Sim connected and sim disconnected.

If I set the text to 12345.0 the display shows 12345.0
If I then set the text to 5432.0 the display shows 15432.0

I tried initializing the text by setting the text to " " before sending the 5432.0 but that does not help.

Is this a bug?
269683479_711800516449946_1628249922036974774_n.jpg
The print statement and hardware show the correct values but the display shows wrong.
ice_screenshot_20211224-201251.png
You can test with this code if you want.

Code: Select all

display_act                   = string.format("%5.1f",5432)
ADF1_display_chr_act          = hw_chr_display_add("ADF1 ACTV frequency",  "MAX7219", 1)

hw_chr_display_set_text(ADF1_display_chr_act, 0, 0,display_act)

but_count=0
hw_button_add("ADF1 Transfer button",function()
	but_count=but_count~1
	display_act= "        "
	hw_chr_display_set_text(ADF1_display_chr_act, 0, 0,display_act)

	if but_count == 1 then
		display_act= string.format("%05.1f",12345)
	else
		display_act= string.format("%05.1f",5432)
	end

print(display_act)
hw_chr_display_set_text(ADF1_display_chr_act, 0, 0,display_act)
end)
Keith

EDIT: Some times it works as it should but 99% not.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#2 Post by Keith Baxter »

Hi,

Ralph, Here is the Zibo 737 ADF1 radio that brought up the issue. I did not have an issue with the VHF and NAV radios other that the "DATA" text on VHF3. I had to change that to " DATA" else I also got the leading two character.

Keith
Last edited by Keith Baxter on Mon Dec 27, 2021 12:30 am, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#3 Post by Keith Baxter »

Hi,

@Ralph , I just ran the code in the first post using the debugger. Works perfectly if I step through the code. hmmm

Keith
Last edited by Keith Baxter on Sun Dec 26, 2021 11:03 am, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Character Display possible issue.

#4 Post by Ralph »

The current MAX7219 implementation isn't that great. But we haven't been able to do any good testing with the displays we have, they're a bunch of crap :) I still have to work on a decent setup for testing.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#5 Post by Keith Baxter »

Hi,

I found the issue thanks to @SimPassion . Thank you Gilles.

IT is a formatting issue. Perhaps this should be explained in the WIKI.
Using a 6 digit display with a decimal point.

Code: Select all

string.format("% 7.03f", 123) will produce "123.000"
string.format("% 7.02f", 123) will produce " 123.00"
string.format("% 7.01f", 123) will produce "  123.0"

string.format("%07.03f", 123) will produce "123.000"
string.format("%07.02f", 123) will produce "0123.00"
string.format("%07.01f", 123) will produce "00123.0"



Note that the format using a decimal is always +1 to the number of digits

So for a 4 digit display not using a decimal and leading blanks "% 4d"
So for a 4 digit display not using a decimal and leading zeros "%04d"
So for a 4 digit display using a decimal and leading blanks "% 5.1f"
So for a 4 digit display using a decimal and leading zeros "%05.1f"

So for a 5 digit display not using a decimal and leading blanks "% 5d"
So for a 5digit display not using a decimal and leading zeros "%05d"
So for a 5 digit display using a decimal and leading blanks "% 6.1f"
So for a 5 digit display using a decimal and leading zeros "%06.1f"


However I still have no idea why the original code worked using the debugger step function. :?

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#6 Post by Keith Baxter »

@Corjan

I know @Ralph mentioned that you guys were having issues testing with the MAX7219

Just a heads up of some of the issues we see.
1) I am having stability issues where all the digits are lighted sometimes and random numbers other times.
2) A few of us on the Discord cannot daisy chain more than 3 MAX7219. If we split 5 displays 3-2 then one display does not light. Yes we use an external 5v PSU

Here is some test code that we are having issues with. I do not want to go to the expense of creating a PCB if this is going to be an ongoing issue.

Code: Select all

--Zibo 737 OVHD ELEC PANEL DISPLAY

-- Add two or more characters displays, All can be daisy chained except for VCC 5V.
OVHD_elec_displays = hw_chr_display_add("OVHD Electrical","MAX7219",5)

--Function to add characters to the displays
xpl_dataref_subscribe("laminar/B738/dc_amp_value", "FLOAT",
		      "laminar/B738/dc_volt_value", "FLOAT",
		      "laminar/B738/ac_amp_value", "FLOAT",
		      "laminar/B738/ac_freq_value", "FLOAT",
		      "laminar/B738/ac_volt_value", "FLOAT",
		      "laminar/B738/electric/panel_brightness","FLOAT[4]",function(dc_amps, dc_volts, ac_amps, cps_freq, ac_volts, bright)

	--Add tables to determine what com is displayed
    local display_dc_amps       = string.format("%9.0f",dc_amps)
    local display_dc_volts      = string.format("%9.0f",dc_volts)
    local display_ac_amps       = string.format("%9.0f",ac_amps)
    local display_cps_freq      = string.format("%9.0f",cps_freq)
    local display_ac_volts      = string.format("%9.0f",ac_volts)

	--Set the characters and opacity of the displays
    hw_chr_display_set_text(OVHD_elec_displays, 0, 0,display_dc_amps)
    hw_chr_display_set_text(OVHD_elec_displays, 1, 0,display_dc_volts)
    hw_chr_display_set_text(OVHD_elec_displays, 2, 0,display_ac_amps)
    hw_chr_display_set_text(OVHD_elec_displays, 3, 0,display_cps_freq)
    hw_chr_display_set_text(OVHD_elec_displays, 4, 0,display_ac_volts)

    hw_chr_display_set_brightness(OVHD_elec_displays,0,bright[4])
    hw_chr_display_set_brightness(OVHD_elec_displays,1,bright[4])
    hw_chr_display_set_brightness(OVHD_elec_displays,2,bright[4])
    hw_chr_display_set_brightness(OVHD_elec_displays,3,bright[4])
    hw_chr_display_set_brightness(OVHD_elec_displays,4,bright[4])

end)
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Character Display possible issue.

#7 Post by Corjan »

Hi,


The MAX7219 boards we have are very unstable in my experience. Daisy chainging two works most of the time, but going above that makes things not stable.
Also tried with a quick Arduino example (without any AM related code), and it is the same case.


I'm not going to invest more time in the software until we find a decent hardware board for this chip,

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#8 Post by Keith Baxter »

Corjan wrote: Mon Jan 03, 2022 3:33 pm Hi,


The MAX7219 boards we have are very unstable in my experience. Daisy chainging two works most of the time, but going above that makes things not stable.
Also tried with a quick Arduino example (without any AM related code), and it is the same case.


I'm not going to invest more time in the software until we find a decent hardware board for this chip,

Corjan
Hi,

It seems that the boards/modules that we are getting have a missing 10µF cap. I soldered in cap's on my two boards I bought for testing and it now seems very stable.

You can see the missing cap next to the diode. The two open holes. + to the header.
image0.jpg

Another user was having issues with 5 daisy chained display modules, also with the 10µF caps missing on his boards. He reports that after soldering in the missing 10µF caps that his daisy chained modules work as they should.

So it would seem that that might be the issue.

I am building PCB's using MAX7219 chips.

Here is the start of what I am going to do.

I am sure @jph will chime in if he sees any oops es. :D . Oh it is not complete, I am looking for ribbon cable headers.
ice_screenshot_20220103-150405.png
Keith
Last edited by Keith Baxter on Mon Jan 03, 2022 5:34 pm, edited 5 times in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Character Display possible issue.

#9 Post by Keith Baxter »

Hi,

I did this back in 2018 using signal 1bit LED's. Going to change to 5bit LED's
ice_screenshot_20220102-044411.png
ice_screenshot_20220102-044427.png
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Character Display possible issue.

#10 Post by jph »

Corjan wrote: Mon Jan 03, 2022 3:33 pm Hi,


The MAX7219 boards we have are very unstable in my experience. Daisy chainging two works most of the time, but going above that makes things not stable.
Also tried with a quick Arduino example (without any AM related code), and it is the same case.


I'm not going to invest more time in the software until we find a decent hardware board for this chip,

Corjan
I believe there is more going on here. The diode drop and the 'missing' capacitor (10uF electrolytic) were previously discussed - https://siminnovations.com/forums/viewt ... 748#p41748 ).
Finding a different board from any source is highly unlikely as all boards I have seen have the cap removed due to removing the pin headers for the displays which meant there was no space on the 'front' side of the board as it was originally under the displays. The changes were made several years ago so, as said, finding a different board is highly unlikely. Although adding the 'missing' cap improves matters for some it appears others have the same issue, or similar issues even after adding the caps (not meaning with AM only). I will investigate further with appropriate test equipment. Joe

edit - clarification.
Last edited by jph on Sun Jan 09, 2022 7:26 am, edited 1 time in total.
Joe. CISSP, MSc.

Post Reply