AnsweredAssumed Answered

Whats the difference betwee HAL_TIM_OC_Start and HAL_TIM_OC_Start_IT

Question asked by Patrick Morwald on Sep 7, 2017
Latest reply on Sep 11, 2017 by Vangelis Fortounas



i am working on PWM output generation and input capture with the timers. What i see in the HAL description is that the OC and capture functions have always a "_IT" interrupt version counterpart.


1. I am generating a static PWM signal, i thought after starting the TIMER peripheral to generate a PWM signal it does this on its own. I assume the CPU is not loaded by the PWM signal generation. Why do i need an interrupt version of the function then if the timer peripheral is operating independently from CPU anyways? This concerns the difference between the two HAL functions HAL_TIM_OC_Start and HAL_TIM_OC_Start_IT.


2. My second case is that i want to measure the duty cycle of a PWM signal and i want to do this with HAL_TIM_IC_Start or HAL_TIM_IC_Start_IT. I really dont know what function to choose. The measured duty cycle is changing seldomly and i only want to do a short measurement from time to time. However, i cannot block the CPU at any time since i am running a lot of other processes on it. What approach is best?