summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-01-10 15:56:21 -0800
committerKeith Packard <keithp@keithp.com>2016-01-10 15:56:21 -0800
commita66e57e0e92cdbd3c6a10b835c50f55647c07351 (patch)
treec9ee920c7c09a5e1ca4f3a25437026e26aeb5a11
parent4e29bcd07819415ebe44e22536305e9c51d9ae4c (diff)
altos: Switch PWM constants to end up exposing µsec
This changes the constants so the clock runs at 1MHz, making the step 1µsec each. Then make the period 20000 steps, or 20ms for a 50Hz frequency as before. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/telemega-v2.0/ao_pins.h4
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 a0c7cc46..9095a350 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 64000
+#define PWM_MAX 20000
#define AO_PWM_TIMER stm_tim4
#define AO_PWM_TIMER_ENABLE STM_RCC_APB1ENR_TIM4EN
-#define AO_PWM_TIMER_SCALE 10
+#define AO_PWM_TIMER_SCALE 32
#define AO_PWM_0_GPIO (&stm_gpiod)
#define AO_PWM_0_PIN 12