LibreSolar/charge-controller-firmware

Use edge-aligned PWM for MCUs with advanced timer TIM1

martinjaeger opened this issue · 0 comments

This increases the resolution of the PWM duty cycle of the DC/DC converter by a factor of 2, which helps to set the ratio between input and output voltage for the MPPT algorithm more precisely.

For TIM3 (as used in STM32L0) it is necessary to use center-aligned PWM mode, as this timer does not feature a dead-time generator. Thus, the dead-time between high-side and low-side MOSFET on-states has to be added manually, which is not possible in edge-aligned mode (as far as I know).