]> www.fi.muni.cz Git - bike-lights.git/commitdiff
lights.h: PWM_MAX for better measurements
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:08:22 +0000 (23:08 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:11:03 +0000 (23:11 +0100)
The PWM frequency should be different than the ADC frequency (125 kHz)
in order to measure in different parts of the PWM cycle (I should have
added a low-pass filter to the ADC inputs, but whatever :-)

firmware/lights.h

index 2c1062c75ce46fb39b563e998d1b2e3a961e172b..d4efae17935552f0c22aeb2c183412b0f7096021 100644 (file)
@@ -28,7 +28,7 @@ void susp_adc();
 void timer_start_adcs();
 
 /* pwm.c */
-#define PWM_MAX 0x1FF
+#define PWM_MAX 0x1E4 /* This should be different than ADC frequency 125 kHz */
 
 void init_pwm();
 void susp_pwm();