RPI Pico Support

Since the new Version does official support the RP2040, I got some questions in regards to actual using it.
Are there any benchmarks in terms of execution speeds compared to STM32 or SAMD ?
Because of the silicon shortage and overall the RP2040 looks like a good solution.

Also, what are the known limitations of the RP2040 SimpleFOC support at the moment ?

Hi @fish42,

The RP2040 is well supported. You can use any of the pins for PWM, and up to 16 channels are supported, so it is quite an easy MCU to set up and connect.
The PWM frequency can be changed within the range 20-66kHz.

We haven’t done any comparative benchmarking with the RP2040 (its on my list of TODOs, I’ve recently set up 7 different MCUs with the same driver and am trying to find time to run some benchmarks).
However, with its dual-core 133MHz design it should be one of the faster MCUs to run SimpleFOC on, and thanks to dual core should have some headroom for doing other things in parallel.

There are no known limitations on the driver side, but we have not yet implemented current sensing for the RP2040, so that would be a limitation compared to ESP32, STM32 or ATMega. Again, it’s on my list. :slight_smile:

thanks for your reply :slight_smile:
sounds promising !
I assume it does work with the RP2040 Arduino implementation ? or any other recommendation for toolchain ?

What is the main challenge (apart from Time :slight_smile: ) for the current sensing implementation ?
Is any ADC Pin of the Pico suitable for this ?


Thank you. Question, can the PWM be set under 20kHz? I am not familiar with RP2040 at all.

Edit: Two more questions. You say there is no limitation on the timer combination for PWM, unlike STM? Third, I see only three ADC capable pins, isn’t that a handicap? If you do inline current sensing that would pretty much max out the analog input pins?

I should allow lower PWMs. It should be possible to go quite a bit lower. At the moment it is limited in code, I assumed no one would want less than 20kHz, but I see now around the discussion with the Infineon FETs and the IGBTs that people could use lower speeds.

The PWM on the RP2040 is more flexible than STM32 or SAMD. You can use any pin, but there are only 16 different PWM channels, so each channel is mapped to more than one pin. You have to pick 3 (or 6) different channels, that’s all.

You’re absolutely right, I didn’t look into the ADC on the RP2040 yet, but there are only 4 inputs, so that would limit you to one motor for current sensing. Looks like that’s the weakness of this chip :slight_smile:

According to the documentation I see three, may be I didn’t read it right.

It’s an educational tool, I am sure for that purpose it hits the target audience 100% and many people find it entirely satisfactory. Not for serious production work though. Even the 20yo 8bit atmel (arduino nano) can take 8 analog inputs. Sometimes it really makes me wonder what goes into these meetings where people sit around, bump heads and proclaim “Yeah, whatever, dude. Three analog inputs ought to be enough for that baby, let’s push it out, look at that cool raspberry image on the chip anyway, huh…”

1 Like