diff options
| author | Keith Packard <keithp@keithp.com> | 2016-01-10 15:44:08 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2016-01-10 15:45:21 -0800 | 
| commit | 4e29bcd07819415ebe44e22536305e9c51d9ae4c (patch) | |
| tree | c341d335fea2ef397b8c730d96a056857e776fbb /src | |
| parent | 54c20f1caf7f2e09284a9839cfa854d71f5634a2 (diff) | |
altos: Set TeleMega v2.0 PWM to support servos
Typical servos use a 50Hz signal with less than 10% duty cycle. Set
the divider to 10 and the range to 64000 to provide a reasonable level
of detail down in the low range.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/telemega-v2.0/ao_pins.h | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/src/telemega-v2.0/ao_pins.h b/src/telemega-v2.0/ao_pins.h index d796826c..a0c7cc46 100644 --- a/src/telemega-v2.0/ao_pins.h +++ b/src/telemega-v2.0/ao_pins.h @@ -387,10 +387,10 @@ struct ao_adc {   */  #define NUM_PWM			4 -#define PWM_MAX			1023 +#define PWM_MAX			64000  #define AO_PWM_TIMER		stm_tim4  #define AO_PWM_TIMER_ENABLE	STM_RCC_APB1ENR_TIM4EN -#define AO_PWM_TIMER_SCALE	1 +#define AO_PWM_TIMER_SCALE	10  #define AO_PWM_0_GPIO		(&stm_gpiod)  #define AO_PWM_0_PIN		12 | 
