Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


You are viewing a reply to pwm with one shot timer  

pwm with one shot timer

France

Hi,
What is the problem in setting the pulse length in HAL_TIM_PWM_PulseFinishedCallback? It will be valid for the next pulse, and I can’t see how it could be changed earlier; setting it in HAL_TIM_PeriodElapsedCallback may be too late for the current pulse (already started) and will thus have a longer latency.
By the way, what do you mean by “just in time”? As you can’t change the period of the PWM output, but only the cyclic/ration (period/pulse_length) you can not obtain an immediate effect, just an effect on the current (if a pulse is current) or on the next pulse (if between two pulses). Just setting CCRx when you decide what the next pulse length must be wil do its effect as soon as possible.
Bernard