MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
LucaT737
Posts: 8
Hi everyone, I hope this is the correct place for the question.
I'm trying to design a PCB for a 737 Collins MCP. My plan is to use an ATMEGA32U4 directly on the PBC since it has a direct USB capability, but the downside is the limited number of pins available. I could partially solve the problem with a 74HC165 for the inputs and some MAX7219 in a daisy chain for the 7 Segments. My question is if I could use one or more 7219 in the same daisy chain to drive the LEDs on the Korry switches. I know I could use the 74HC595 but that would require additional pins on the ATMEGA and the few I have are precious.
I'm not at home at the moment so I have no way to test it myself.
Alternatively I could use an ATMEGA2560 but that would require an USB interface and I'm not super confident with this kind of connections so the risk of developing an incorrect PCB and waste money would be way higher.
Thanks in advance for any useful answer!
2023-04-22 12:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

To answer the first question.....

Max7219 for LED is not directly possible.
Mobiflight use a Library for the Max and send data via FontB Code.
Means we not say "Light Segment a,b,d,e, or so.... We say "Show a "1" on Display.
So its not directly possible to light 8 individual LED instead of a single Segment Digit.

About the Arduino....

If you got high solder skills you can for sure mount the Arduino directly on PCB ( Or let do this the PCB Manifactur for you).

Much more easy and also more flexible is to "mount" a premade Arduino onto the PCB instead if a direct inegration.
Simply design a PCB with the "footprint" of a Arduino.
Then you just solder Male Pine Lines on the PCB and plug the Arduino onto it.
Advantage.... You not need to handle the IC and all the Elements of the Arduino and you can use the premade USB Connector.
Good Luck !
2023-04-29 15:10
Avatar
LucaT737
Posts: 8
Good evening Pizman,
first of all thanks for your answer, that clarifies my question perfectly. Also sorry about the delay on my response.

I see the "problem" with the library, sometimes knowing how things works in the background helps a lot.

About the Arduino: yes the idea was to design a PCB with easyEda and have it printed by a manufacturer. They are relatively inexpensive and I had some projects done this way in the past (some using Mobiflight and some not related to simulators at all) including one where I did exactly as you said by creating the footprint for the Mega on the back of the panel and that worked perfectly.
However since I almost have more fun in designing and creating those panels than actually using them in the sim I wanted to create something that is fully integrated on the PCB and is as neat as possible (see it as my personal challenge :D ) so I'm trying to figure out the best way to do it. I'm a newbie in electronics but I like doing things on my own for the fun of it so here I am asking questions :D :D :D

Thanks again in the meantime, you'll hear from me if I have more questions!
2023-05-28 01:09
Avatar
brenosilver
Posts: 3
iconpizman82:

Hi

To answer the first question.....

Max7219 for LED is not directly possible.



I apologize for revisiting this older thread. However, I'd like to clarify the comment regarding the use of the Max7219 to drive individual LEDs as opposed to the traditional 7-segment display.

I have not seen an answer for how to do this "indirectly" so I am posting here for others to see this and not get discouraged. It's entirely feasible to individually drive LEDs using Max7219 in mobiflight. In fact, that's precisely how I've set up my FCU buttons. Do note that there's a limitation on the number of LEDs you can employ because there are only a finite number of combinations available in the 7-segment display.

In essence, the wiring for each LED should be connected to the digits and segments on the Max7219 in such a manner that the respective numbers used to activate or deactivate them don't interfere with each other. For instance, with 6 LEDs, each can be wired to its own digit on the Max7219, all utilizing the A segment. This setup ensures that 0's illuminate the LED, while 1's turn it off. For each LED, I assign a variable that functions like a bit, meaning six LEDs would correspond to a 6-bit number. Their default setting would be 111111.

In an output, I subtract all the bits and determine which LEDs should be lit or dimmed. If I wish to light up the first digit, I simply deduct 1 from the number. For the second LED, I'd subtract 10, for the third, it's 100, and so on.

For setups involving more than 7 LEDs, you can adopt a similar approach with other segments. However, you should pay attention to the combination of digits/segments and numbers to use to ensure that the resulting number doesn't lead to conflicts, i.e., lighting the same segment for two distinct LEDs.

While this method might appear unconventional, it's effective nonetheless.
[Last edited by brenosilver, 2023-10-03 23:28]
2023-10-03 23:15
icon