2018-03-04 01:18 PM
Spotted a small error on the Timer application note AN4013r6 (Cross Series Timer Overview), page 15.
Pulse Length of a One Pulse Mode is shown as: Pulse-Length = (ARR - CCRy)/(TIMx_CLK/(PSC + 1))..but by referring to the timing diagram in the Reference Manual (RM0090) of a MCU (STM32F407 for example), with my own experiment to confirm it to boot, that it should be Pulse-Length = (ARR - CCRy-1)/(TIMx_CLK/(PSC + 1)) instead.
I am not sure if there is another way to interpret or apply the equation..but it costs me some minutes to counter-check my config to find out because I started with the application note before digging further into the reference manual.
Please correct me if I am wrong.
I
#an4013 #error #pwm #timer #stm32f4 #opm2018-03-04 04:03 PM
Well spotted!
However, your formula needs proper bracketing
Pulse-Length = (ARR - (CCRy-1))/(TIMx_CLK/(PSC + 1))
or, it would be more appropriate to write
Pulse-Length = ((ARR + 1) - CCRy)/(TIMx_CLK/(PSC + 1))
as the raw reason is in that the 'pulse' lasts from CCRy to ARR *inclusive* (and the delay before that lasts from 0 to (CCR-1) inclusive).
Btw. that AN contains also Clive's 'favourite' errorneous calculation of the time between two consecutive captures... :)
JW
2018-03-04 11:24 PM
Almost committed another mistake to the already wrong formula, thanks for pointing out!
2018-03-06 04:37 AM
Hi
Goh.Seng_Tak
&Waclawek.Jan
,This error is confirmed. It is reported, and will be fixed in next version of the application note.
Thanks for bringing it to our attention.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.