STM32L4 + Timer IT + µs counter
Hi All,
I'm using STM32L486RG microcontroler, And 1Wire EEPROM.
I have to use Timer to compute delays type ( delay for 5 �s to 500 �s).
And I'm asking on How to Re-configure Timer on it's interrupt callBack and restart it.
However, I was successfully able to disable the timer once IT callBack was generated. and I restarted it in my freeRTOS task,
I was able to visualize time from oscilloscope, and it was correct timing.and now, I have to reduce more and more CPU charge by Restatring It on it's Interruption CallBack.
Below my IRQ handler Algorithm:void TIM1_UP_TIM16_IRQHandler (void)
{ if(LL_TIM_IsActiveFlag_UPDATE(TIM1) == 1) { /* Clear the update interrupt flag*/ LL_TIM_ClearFlag_UPDATE(TIM1); /* Disable the Timer*/ LL_TIM_DisableIT_UPDATE(TIM1);/* Reconfigure the Timer and restart*/
LL_TIM_SetAutoReload(TIM1, XXX); // Another Timer Period (depending on my 1Wire EEPROM state) LL_TIM_EnableIT_UPDATE(TIM1); } }Using this method, Timing is not correct, and my eeprom is not working correctly.
Can you help me please ?
Best Regards.
#stm32l4 #eeprom #microseconds #1wire #free-rtos #stm32l4-timer #timer-interrupt