2018-07-24 08:51 AM
I have successfully measured the period (2us) of some pwm signals with timer3 with the NUCLEOh743 board with this code:
uint32_t inputCaptureVal;
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
UNUSED(htim);
if (htim->Instance==TIM3)
{
inputCaptureVal=__HAL_TIM_GetCounter(htim);
__HAL_TIM_SetCounter(htim,0);
}
}
With this: htim3.Init.Prescaler = 20; and the chip running at 96MHz, i should be able to measure a 1us period with 208.83ns accuracy. However, i am unable to measure anything under 2+us. Also for a period of 170us i am measuring 163us and i am encountering similar faults for different measurements. Any ideas?
I would like to use HRTIM in order to measure smaller times between two events (pwm or anything else). Is that possible with a similar approach by using
HAL_HRTIM_Capture1EventCallback
??
thanks and please help me with any mistakes i might be making
2018-08-09 09:26 PM
@ST Community any FAEs covering HRTIM functionality?