AnsweredAssumed Answered

STM32L4 + Timer IT + µs counter

Question asked by Ghada Dhibi on Apr 24, 2017
Latest reply on Apr 24, 2017 by Clive One

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.

Outcomes