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! 

icon
Avatar
SergeyPe
Posts: 25
I have a strange issue with Arduino Mega clones- the pin #13 is not working.
In my previous MobiFlight projects I was using the compact Mega's from Robotdyn- with their small size they are much easier to install if the enclosure space is limited. On all the boards that I was using the pin #13 was not working at all. I thought that it could've been related to a particular board type; however in a recent project I used the full-size Mega clone and again the pin #13 was not working.
I'm not a superstitious type of person, so most likely the problem lies somwhere else than the pin number:rolleyes: . Could anybody confirm that the pin #13 is working on their Mega boards?
2021-02-05 07:49
Avatar
patEGWU
From: Northolt, United Kingdom
Posts: 8
Hi SergeyPe,
I have D13 on one of my Megas connected to a button - works fine. I usually avoid using it in all my Arduino projects, because it has an internal LED connected and I'm never sure how it can affect things. Are you using it for an input or output?
2021-02-06 03:51
Avatar
SergeyPe
Posts: 25
Hi patEGWU,
This is what one of my colleagues told me. I've tried using it for an input; maybe it also depends on a particular Mega clone. Thanks for the info anyway!
2021-02-06 18:37
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4339
Supporter
Hi Guys.

As i know Pin13 is technical bridged with the internal LED on the Arduino ( Maybe fully wrong but i heard it that way)
Means if the Status Light is Blinking on the Mega we could see this blinking also on a LED on Pin 13.

BUT
This element should be diabled with the Mobiflight Firmware as i understand.... So this is no longer a factor i think.

So we got lots of possible situations now.
In case no other user report this, all looks strange. Maybe a massive coincidence that thousends of other Configs have no LED on that pin ( i can´t belive)

If you like you can do some testing progress... This make it more easy for us to reproduce the issue. Else it will take a longer time until i can check this myself.

Step 1. Reduce testing ground to the most basic situation.
Mega ( fresh or EEPROM cleared) .... with Firmware flashed. ONLY 1 device created on Pin 13. ( e.g. a Button) . Only Wired Pin 13 and one GRD Pin.
A New Config with only one Input Line..... And a Simple Test like Parking Brake or better just the "logging mode".

Step 2. Testing other device typs (Output) .... So also LED (and 7Seg and motors if you like.)
Use also only one Config Line and the TEST Function in the Display Tab.
And get sure you have a clean wire logic.... E.g for LEd use Pin ---> Resistor ---> LED Anode ..... LED Cathode ---> GRD. And nothing else.

Step 3. Doublecheck the same situation on multiple Megas if you got them
*************

In easy words.... Try to eleminate issue spots, like wrong wires, electrical Limitations, Config Issues, Double Pin usage and so on. As more rudimentary the test as better is the result !
Good Luck !
2021-02-07 01:16
Avatar
Brynn
Posts: 1
Pin 13 is connected to the LED. This causes a problem depending on who manufactured to arduino and the particular components they use.

In some cases when the pin is used with INPUT_PULLUP the led on the pin draws enough current (although it does not light) to pull the pin into the LOW condition.

With some clones of the Arduino pin 13 works fine in the mode, with others it get pulled LOW all the time. If you want to use pin 13 for a button, remove the LED.
2021-02-07 13:13
Avatar
SergeyPe
Posts: 25
Thanks gentlemen,
As mentioned, the problem was reproduced on a number of Robotdyn mini-Mega PCB's (5 or 6) with different configs; I am not a novice with MobiFlight, so the configs are not a problem. Now it's repeated with 3 full-size Mega clones with a switch or an encoder, or a LED connected- doesn't matter.
As there is a physical connection of LED (with a resistor, I presume) to a pin #13, obviously there is no way to disable it in the software. Not a big deal, I'll just keep it free of any connections.
2021-02-13 15:29
Avatar
tigertfly
Posts: 3
Supporter
Yeah, I also noticed this when I used the "MEGA Pro Mini" (those are great boards to just piggypack on the backside of a panel PCB).

I have an encoder in that pin on my autopilot project, and it behaves very erratic, sometimes it works and other times it just jumps back and forth. so I need to cut the trace and physically patch it to a different pin.

-T
Yesterday 22:30
icon