#RP2040 PWM Pins

1 messages · Page 1 of 1 (latest)

humble bloom
#

Hello all, I had the impression that basically every GPIO pins in RP2040 can be used as PWM. However, in my latest PCBs where I used A2 and 20, MF does not recognize these as PWM. I know this is not a hardware limitation, but probably some MF profiling per board. I am told that editing a "boards" file can fix this.

May I know if this is a mandated "rule" with MF ? Or are there important reasons for this? Thank you all.

#

...and if I may add, which pins of the RP2040 is treated as PWM in MF point of view?

narrow sigil
#

The RP2040 has the little complication that there are only 16 PWM channels. One for GPIO 0 and 16, one for 1 and 17, and so on, always for n and n+16, all the way to 13 and 29 (A3). 14 and 15 have no counterparts since only 30 GPIOs are available.

#

To simplify the logic a bit and prevent unexpected collisions, the board definition that ships with MobiFlight has pins 0-15 marked as PWM-capable and pins 16-29 (or more precisely 16-22 and 26-28 (A0-A2), since 23-25 and 29 are not available on RP Pico) as non-PWM.

#

So the easiest way to use PWM is to use pins 0-15.

humble bloom
#

Delta, that is an eye opener. I didn't know this until the PCBs arrived using a "non-approved" PINs in MF. Thank you for this. Will there be by any chance changes to these definitions in the future?

narrow sigil
#

you can make your own custom board definitions if you want to use different pins. I would not expect any changes to the existing ones, personally, but things can always happen.

#

Personally, on my first RP2040 boards, I accidentally used pins that are not on the RP Pico (like D23) and had to work around that with custom board definitions

humble bloom
#

Yeah, but the problem with maintaining my own custom board definitions is that I will have to ship this with every panel sold to customer. And I believe every update to MF will reset this.

narrow sigil
humble bloom
#

right

#

thank you for your time in answering my questions. means a lot, and something learned.

tranquil geode
#

there is a config ralf made

#

but ideally you want to define a custom board type to your custom pcbs since nobody is going to add or change the pins on them anyway

#

the firmware will be the same

#

but the extra pins will be available

#

@humble bloom you can also talk to Sebastian to have them added to MobiFlight

#

the current ways of bundling with the release is not very scalable but now with the new UI and more visibility to the "known" boards in the UI too

#

it makes sense for users also

humble bloom
#

Will the definition also be stored in the board's firmware?

tranquil geode
#

there is also work to make the configs auto-resolve serial numbers

humble bloom
tranquil geode
#

we really really need better documentation for MF partners who make panels and get this going but it is a bit under construction still

#

it is

humble bloom
#

so far MF has been slick and runs well with my panels.... only today when I got myself the new PCBs of a new project did I learn this 😄

tranquil geode
#

so the puzzle pieces are a bit loose on the table so far so to say

#

but in the end it would be great if someone who wants to build panels with MF can get in touch and get the stuff added to the app so it just works for users

#

of course whether its a repository of known boards in the app or in a server a bit like hubhop is still a bit under thinking

#

and how to deal with this in terms of updates and hardware versions etc

#

but in a way I would love to have all the businesses doing stuff with mobiflight to see each other as friendly rivals that push each other forward to even better experience for users. Because nobody wants to maintain their own app if we can have infra that works for all.

humble bloom
#

I hate the idea of writing my own bridge app.

#

I have ppl who can code, but if I can stick with the open system MF, I would prefer it this way

tranquil geode
#

rather pool the effort and support the project so we can make something even better

humble bloom
#

exactly.

tranquil geode
#

that also enables people to create profiles with a common system

humble bloom
#

and there's only one breaking point software-wise if there are updates etc...

tranquil geode
#

yeah

humble bloom
#

like this tiller, it's "ready" but not quite.. I still need it to snap to center when it is inside the deadzone

tranquil geode
#

if you try out that test zip from the link above, unzip it to a separate folder and you can test it from there

humble bloom
tranquil geode
#

those things are just ideal for this, "ok found tiller, and you use FBW, lets use it"

humble bloom
#

and coding in RPN is mind twister LOL

tranquil geode
#

yea, its way easier in 2024 though with B-events

#

if the plane has them

humble bloom
tranquil geode
#

heh that happens cough