2023-12-14 05:15 AM
2023-12-14 07:57 AM
It takes time to execute the interrupt service routine. MHz interrupt rates are irrational, especially so if you use Cube/HAL.
JW
2023-12-20 10:02 AM
Thank you very much for your response,
but what can you recommend,
is there any other library in CubeIDE(without HAL) that can improve the situation for the better? .(I didnt want to use assembler)
For example I checked the external interrupt , and that is delayed in HAL by about 350ns.
But there is I have one more incomprehensible problem, I started the timer_1 in slave mode,
I started PWM in mode DMA . How can I make the DMA start counting(reset count) the array(my_pwm_Data[]) from scratch(zero position),
with the arrival of the timer trigger signal(from another Timer) . The period of the trigger signal is 100 µsec,
and the period of the slave timer itself is 1 µsec.
Becouse my PWM variable 0 position (my_pwm_Data[0] ) does not match with my trigger signal start .
uint16_t my_pwm_Data[100] = {0,1,2,.....} ;
...................
uint16_t my_PWM_period_count_length = 100 ; ///// param Length The length of data to be transferred from ///// memory to TIM peripheral
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_3, (uint32_t*)my_pwm_Data, my_PWM_period_count_length) ;
thank you in advance
2023-12-20 10:11 AM
SLAVE MODE = RESET MODE
AUTO-RELOAD PRELOAD = Enable
DMA SETTINGS = TIM1_CH3 ; MEMORY TO PERIPHERAL ; INCREMENT ADDRESS MEMORY = YES ; LENGTH = Half Word