2017-07-26 12:57 AM
Hi All,
I'm using
https://community.st.com/0D50X00009XkYWYSA3
86RG microcontroler, Andhttps://community.st.com/0D50X00009XkYWYSA3
https://community.st.com/0D50X00009XkYWYSA3
.I have to use
Timer to compute delays type ( delay for 5 µs to 10ms ).Thanks to
Turvey.Clive.002
‌, I was able to reload timer period only with writing in theTIM1->ARR register with the new period. (
https://community.st.com/0D50X00009XkYWYSA3
)I'm asking now how to reload this timer to generate period from 5µs to 10ms in the callback function of the timer it self.
i.e: from TIM1->PSC = 0; TIM1->ARR = 399; to TIM1->PSC = 15; TIM1->ARR = 49999;
I'm a little confused that I didn't have the correct new period.
What did i miss ? or what should I do ?
Can you help me please ?
Best Regards.
Ghada.
#1wire #timer-interrupt #stm32l4 #eeprom #microseconds #milliseconds #stm32l4-timer #stm32l4-timer-interrupt-spurious2017-07-26 01:16 AM
Hello!
to Have a microsecond resolution put at
TIM1->PSC
=( (sysclock/1000000)-1) I supose that your timer is clocking with sysclck frequency E.g. 80000000 Hz(PSC=79)So, to produce a 5 to 10000 microsecond period ,
TIM1->ARR
must be from 4 to 9999!2017-07-26 04:09 AM
For a delay spin loop I'd likely free run the TIM in maximal mode, ie ARR of 65535, and then delta the ticks on CNT.