EMERSON KJ3007X1-BA1工控控制卡件
因此,不可能在给定时间内捕获所有四个计时器的值。然而,通过将该位设置为“1”,所有四个定时器输出将仅在读取定时器1和2电流计数寄存器(TMRCCR12)时被锁存。因此,为了同时捕获所有四个计时器的当前计数,首先执行对TMRCCR12的读取(32位读取),然后读取TMRCCR3和TMRCCR4。第一次读取(到TMRCCR12寄存器)导致同时锁存所有四个定时器值。对TMRCCR3和TMRCCR4寄存器的后续读取不会锁存新的计数值,从而可以获得同一实例中所有计时器的计数。定时器1和2加载计数寄存器(TMLCR12)定时器1和定时器2为16位宽,并从定时器1和2中加载计数寄存器中获取其加载计数(TMRLCR12),该寄存器位于BAR2中地址的偏移0x10处。
As a result, it is not possible to capture the values of all four timers at a given instance in
time. However, by setting this bit to “1”, all four timer outputs will be latched only on
reads to the Timer 1 & 2 Current Count Register (TMRCCR12). Therefore, to capture
the current count of all four timers at the same time, perform a read to the TMRCCR12
first (with a 32-bit read), followed by a read to TMRCCR3 and TMRCCR4. The first
read (to the TMRCCR12 register) causes all four timer values to be latched at the same
time. The subsequent reads to the TMRCCR3 and TMRCCR4 registers do not latch
new count values, allowing the count of all timers at the same instance in time to be
obtained.
Timer 1 & 2 Load Count Register (TMRLCR12)
Timers 1 & 2 are 16-bits wide and obtain their load count from the Timer 1 & 2 Load
Count Register (TMRLCR12), located at offset 0x10 from the address in BAR2.