arduino / ArduinoCore-mbed

Repository from Github https://github.comarduino/ArduinoCore-mbedRepository from Github https://github.comarduino/ArduinoCore-mbed

Nano RP2040 Servo pulsewidth imprecision

gxy812 opened this issue · comments

Observed downward fluctuations of more than ~30 us when writing a 1500 us pulse to 7 different pins.
Caused a lot of random spinning as I was using the signal for ESCs.

Used the Servo.h library as provided by this core.

const byte motor_pins[7] {2, 3, 5, 6, 9, 10, 11};
Servo motors[7];

void setup() {
    for (int i = 0; i < NUM_MOTORS; i++) {
        motors[i].attach(motor_pins[i]);
        motors[i].writeMicroseconds(1500);
    }
}