2015-06-23 02:07 AM
Hello,
I do not understand why the TIMER instance is stopped when a specific bloc is stopped. For example, I have 2 output compare channels activated on TIM2 with interruptions. If I use HAL_TIM_OC_Stop_IT in order to stop one of these OC bloc, the HAL ''__HAL_TIM_DISABLE(htim)'' is called and so the result is a complete stop of the TIM2 (and so my second OC is not running anymore). I think this is not a good operation, what do you think ? Thanks !2015-07-02 04:05 AM
Hi,
The function ''__HAL_TIM_DISABLE(htim)'' disable the counter (so all the timer is stopped) only if all channels are disabled.The mask ''CCER_CCxE_MASK
'' corresponds to CCxE bits (Capture/Compare output enable)in the TIMx_CCER register.#define __HAL_TIM_DISABLE(__HANDLE__) \
do
{ \
if
(((__HANDLE__)->Instance->CCER & CCER_CCxE_MASK) == 0) \
{ \
(__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \
} \
}
while
(0)
But, I'm wondering if you tested really the issue or you have concluded that the timer is stopped only by referrring to the code?
Regards
2015-07-03 12:46 AM
Hi,
Thank you for your help and sorry because it's true that it was during my analysis of the libraries. It works properly. Thanks again !!