<p>I'm working on an application that needs to precisely measure the period a very fast incoming pulse train (on the order of tens of microseconds).</p>
<p>While working on this, I came across "TIMER_ERR_01" as described <a href="../lit/er/slaz742d/slaz742d.pdf?ts=1763564998637&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FMSPM0G3106">here</a>.</p>
<p>Does this mean that the timer is incapable of automatically resetting itself?</p>
<p>Following the example timx_timer_mode_capture_duty_and_period, I wrote this:</p>
<pre class="language-c"><code>uint32_t hw_freq_get_period((GPTIMER_Regs * instance)
{
// See TIMER_ERR_01 errata.
DL_TimerG_setTimerCount(instance, 0);
return DL_TimerG_getCaptureCompareValue((GPTIMER_Regs *) instance, DL_TIMER_CC_1_INDEX);
}</code></pre>
<p>If I feed this a steady square wave, I get a consistent result, however if I add any code before setTimerCount, I get a slightly different result.</p>
<p>Is there any way to implement this where the period counter is not affected by firmware execution?</p>