Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 / RP2040 Port #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ESP32 / RP2040 Port #14

wants to merge 1 commit into from

Conversation

qqqlab
Copy link

@qqqlab qqqlab commented Oct 23, 2023

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.

@qqqlab qqqlab changed the title ESP32 Port ESP32 / RP2040 Port Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant