From 0982f8d7c9fcf1766b4060f6a636c8891428923f Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 6 Jun 2021 15:07:54 +0200 Subject: [PATCH] Increase charge pump frequency to 500 Hz This change reduces the voltage drop with higher loads, for example if both the solar and the load switch are on at the same time. --- src/charge_pump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charge_pump.c b/src/charge_pump.c index 825c5d3..421093e 100644 --- a/src/charge_pump.c +++ b/src/charge_pump.c @@ -32,7 +32,7 @@ void charge_pump_init(void) timer_set_prescaler(TIM1, 48 - 1); // Timer runs at 1 MHz // auto-reload value - timer_set_period(TIM1, 10000 - 1); // overflow every 10000 cycles = 100 Hz + timer_set_period(TIM1, 2000 - 1); // overflow every 2000 cycles = 500 Hz // output compare value timer_set_oc_value(TIM1, TIM_OC1, 100); // High for 100 cycles = 100 μs