ESP32 / RP2040 Port
UPDATE: a further developed port for RP2040 and ESP32 is here
========================================== Hi Nick,
I really love you work and extensive documentation! However, I didn't have a Teensy laying around, and wanted to try things out right now... So I made a ESP32 port, keeping the original code untouched as much as possible. Maybe this is something you want to include in your repository?
Thanks & greetings, Hugo
Ported & tested
USE_PPM_RX USE_MPU9250_SPI
Ported but untested
USE_MPU6050_I2C (compiles, but I don't have a MPU6050 to test)
Not ported
USE_PWM_RX USE_SBUS_RX USE_DSM_RX
Changes
Add SPI & I2C pin selection Change hardcoded LED output pin to constant ledPin Use ESP32_PWM.h for servo and oneshot Replace Oneshot pin-set-wait-clear code in commandMotors() with ESP32_PWM running at 2000Hz Change m1_command_PWM, server1_command_PWM, ... from int to float for increased PWM resolution Add variable loop_us to measure runtime of loop()
Performance
On ESP32 240MHz the loop() runtime with MPU9250 is 400 us. This gives 100 us headroom at 2000 Hz. The heaviest function is getIMUdata(), which takes 250 us, so the rest of loop() only takes 150 us.
The top-updated link to the further-developed port for RP2040 seems not to work anymore.