Cannot attach servo on some GPIOs
Posted: Fri Jan 24, 2020 9:20 am
I'm using the dev-board Nucleo 144 F429ZI for a specific project where I need to attach 20 servos (or 20 led).
I'm facing two problems:
1. The following GPIO doesn't output the PWM signal:
Reading the https://os.mbed.com/platforms/ST-Nucleo-F429ZI/ I don't see evidence they cannot be used as GPIO (or timer's output for led).
Am I wrong? What should I check further?
2. Because the standard library allows maximum 12 channles per timer and only one timer is defined I had to change it. The first thing I tried is to add a second timer in `ServoTimers.h`:
But it didn't work. Only the first 12 channels are available.
Next I changed the number of servo per timer in `Servo.h`:
This time all the servo are working (except the GPIO above) but of course the PWM frequency slowed down from 50 Hz to 33 Hz.
Why adding a second timer doesn't work?
By the way, this is my GPIO table:
As said I selected those pins because instead of servos I may need to output 20 PWM for leds.
I'm facing two problems:
1. The following GPIO doesn't output the PWM signal:
Code: Select all
PA0 CN10.29
PB10 CN10.32
PA6 CN7.12
PF7 CN9.26
PF8 CN9.24
Am I wrong? What should I check further?
2. Because the standard library allows maximum 12 channles per timer and only one timer is defined I had to change it. The first thing I tried is to add a second timer in `ServoTimers.h`:
Code: Select all
typedef enum {
_timer1,
_timer2,
_Nbr_16timers
} timer16_Sequence_t;
Next I changed the number of servo per timer in `Servo.h`:
Code: Select all
#define SERVOS_PER_TIMER 20 // the maximum number of servos controlled by one timer
Why adding a second timer doesn't work?
By the way, this is my GPIO table:
Code: Select all
| # | Name | Timer | Conn.| Pin |
| 1 | PE9 | PWM1/1 | CN10 | 4 |
| 2 | PE11 | PWM1/2 | CN10 | 6 |
| 3 | PE13 | PWM1/3 | CN10 | 10 |
| 4 | PE14 | PWM1/4 | CN10 | 28 |
| 5 | PA0 | PWM2/1 | CN10 | 29 |
| 6 | PB3 | PWM2/2 | CN7 | 15 |
| 7 | PB10 | PWM2/3 | CN10 | 32 |
| 8 | PB11 | PWM2/4 | CN10 | 34 |
| 9 | PA6 | PWM3/1 | CN7 | 12 |
| 10 | PC7 | PWM3/2 | CN7 | 11 |
| 11 | PC8 | PWM3/3 | CN8 | 2 |
| 12 | PC9 | PWM3/4 | CN8 | 4 |
| 13 | PB6 | PWM4/1 | CN10 | 13 |
| 14 | PD13 | PWM4/2 | CN10 | 19 |
| 15 | PD14 | PWM4/3 | CN7 | 16 |
| 16 | PD15 | PWM4/4 | CN7 | 18 |
| 17 | PE5 | PWM9/1 | CN9 | 18 |
| 18 | PE6 | PWM9/2 | CN9 | 20 |
| 19 | PF7 | PWM11/1 | CN9 | 26 |
| 20 | PF8 | PWM13/1 | CN9 | 24 |