From 714e86c96ff93fb78d4340cb607c12927091417b Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 1 May 2005 15:36:43 +0000 Subject: Ajout de e_sat. Ajout de moyenage de d. Ajout d'un print des paramètres. Mesures des robot. Période d'asservissement 1.1 ms. PWM à 14KHz. --- n/asserv/src/pwm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'n/asserv/src/pwm.c') diff --git a/n/asserv/src/pwm.c b/n/asserv/src/pwm.c index 4ab8722..a200213 100644 --- a/n/asserv/src/pwm.c +++ b/n/asserv/src/pwm.c @@ -44,7 +44,7 @@ static inline void pwm_init (void); /** Preprocess a PWM value before sending it to hardware. */ -static inline uint8_t +static inline uint16_t pwm_preproc (uint16_t v); /** Update the hardware PWM values. */ @@ -62,7 +62,7 @@ pwm_init (void) Fpwm = f_IO / (2 * prescaler * TOP) = 28912 Hz. */ TCCR1A = regv (COM1A1, COM1A0, COM1B1, COM1B0, COM1C1, COM1C0, WGM11, WGM10, - 0, 0, 1, 0, 1, 0, 0, 1); + 0, 0, 1, 0, 1, 0, 1, 0); TCCR1B = regv (ICNC1, ICES1, 5, WGM13, WGM12, CS12, CS11, CS10, 0, 0, 0, 0, 0, 0, 0, 1); /* Enable pwm and direction outputs in DDRB. */ @@ -70,11 +70,11 @@ pwm_init (void) } /** Preprocess a PWM value before sending it to hardware. */ -static inline uint8_t +static inline uint16_t pwm_preproc (uint16_t v) { - if (v > 255) - return 255; + if (v > 511) + return 511; else return v; } -- cgit v1.2.3