Question
PWM generation exact number of pulses
We are generating PWM using the STM32F429 TIM10 --
In this call-back function we counting the PWM pulses and , when counting pulse is equal to the total pulse then stop the PWM.But in this code counter are counting the properly counting
the pulses but actually hardware send the some pulses extra for above the 70KHz frequency.
for example, suppose my total pulse is 650000 with 100000KHz frequency,when we start the generating the PWM pulse then the HSO_Count[0] counting the pulse, this buffer is showing
correct pulses but actually hardware transmit the 650030 pulses.
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
{
if(htim -> Instance == TIM10)
{
if(htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1)
{
HSO_Count[0]++;
if(HSO_Count[0]==HSO_Count_Total[0])
{
HAL_TIM_PWM_Stop_IT(&htim10, TIM_CHANNEL_1);
}
}
}
}
