Go Down

Topic: Metro M4 Express: problem with using pins A0-A4: all timers in use (Read 167 times) previous topic - next topic

martybillingsley

Using CircuitPython with Metro M4 Express.

This code works to set up a continuous servo:
    pwm = pulseio.PWMOut(board.D4, frequency=50)
    motor = servo.ContinuousServo(pwm)
This works on all the digital pins I tested.

Change the pin to A5, and it still works:
    pwm = pulseio.PWMOut(board.A5, frequency=50)
    motor = servo.ContinuousServo(pwm)

Try using other analog pins:
    pwm = pulseio.PWMOut(board.A3, frequency=50)
    motor = servo.ContinuousServo(pwm)
results in an error message: "All timers for this pin are in use"

This code works with servo motors plugged into A3 and A4 on a Metro M0.
When I switched to a Metro M4, the error cropped up.

Any idea why this is happening? Suggestions?

westfw

Quote
Any idea why this is happening?
Perhaps all the timers for that pin are in use.  Not all pins have all of the same capabilities - A1 to A3 have a TCC type timer, while A4 and A5 have TC type timers...
I don't know what the servo circuitpython library requires.  Perhaps since you're not using Arduino Hardware, and you're not using Arduino Software, this is not the best place to ask this question...

Go Up