2019-03-22 12:09 PM
Hello:
Using a single timer (TIM2) on an STM32L4, can the IC be set up so that it can function down to 300Hz, while the PWM is generating 20KHz?
Using CubeMX to do the device setup. I can not change the counter period as it is set correctly to generate the PWM. The only option is the prescalar, which can be DIV8. If the PWM generation is based on the PERIOD, does that impact the IC?
Thanks!
2019-03-22 12:15 PM
Create a 32 bit global RAM counter which is incremented at each timer overflow to create by SW the additional bits needed to run a 48 bit timer. When you get an input capture, grab the timer capture register and the global MSB and save it. Next capture do the same and substract to get the period.
There maybe other ways.
2019-03-23 07:00 AM
hi, thanks for your answer. I discovred two things. 1, I had missed a CubeMX setting. 2, it does work. I guess the capture and PWM generation are completely different entities? In any case, resolved.