auralix / alx-202-af-10-1-auralix-c-lib

GNU General Public License v3.0
0 stars 0 forks source link

alxPwm_McuStm32 - add frequency & resolution to Ctor.. now we have "svinjak" with prescaler & period uint32.. #19

Open tomazvidovic opened 1 year ago

tomazvidovic commented 1 year ago

The goal: 1) Understand everything about the problem


AlxPwm_Ctor(..., float desiredFreq_Hz, uint32_t desiredMinRes, bool isFreqPriority, float freqTolerance_pct...)

float desiredFreq_Hz --> what frequency we want PWM signal to be

uint32_t desiredResolution --> what resolution we want, meaning how many steps will there be in one period of PWM signal

Parameters that we need for calculations:


We also what that after calculations, all "dejanske" values are saved in module struct, so that can you see what algorithm calculated in Debugger

PWM signal resolution:

https://www.google.com/search?q=pwm+signal+resolution&oq=pwm+signal+resolution&aqs=chrome..69i57.7099j0j7&sourceid=chrome&ie=UTF-8