4
0
1
2
3
4
0
1
0 1
0
VCLK2
HR Clock
LR Clock
Instruction
Counter
Pin HET[0]
Z-Flag
LRP
HRP
25-bit ECMP
match
Pin action in next
loop resolution cycle
CNT resets
Sets Z-Flag
Opposite Pin action in
next loop resolution
cycle
1
1
1
1
1
1
0
0
0
0
0
N2HET Functional Description
972
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
The CNT and ECMP instructions are executed once each loop resolution cycle. When the CNT instruction
is executed, the specified register (A) and the CNT instruction data field are both incremented by one.
Next the ECMP is executed and the data field of the ECMP is compared with the specified register (A). If
both values match, then the pin action (PULSEHI in this case) will be performed in the next loop resolution
cycle. The CNT continues incrementing each loop resolution cycle. When the data field overflows (max +
1), then the Z-flag is set by the CNT instruction. In the next loop resolution cycle, the Z-flag is evaluated
and the opposite pin action is performed if it is set. The Z-flag will only be active for one loop resolution
cycle.
Figure 23-10. Loop Resolution Instruction Execution Example
23.2.5.3 High Resolution Structure
All 32 I/Os provide the HR structure based on the HR clock. The HR clock frequency is programmed
through the Prescale Factor Register (HETPFR). In addition to the standard I/O structure, all pins have HR
hardware so that these pins can be used as HR input captures (using the HR instructions PCNT or
WCAP) or HR output compares (using the HR instructions ECMP, MCMP, or PWCNT).
All five HR instructions (PCNT, WCAP, ECMP, MCMP, and PWCNT) have a dedicated hr_lr bit (high
resolution/low resolution; program field bit 8) allowing operation either in HR mode or in standard
resolution mode by ignoring the HR field. By default, the hr_lr bit value is 0 which implies HR operation
mode. However, setting this bit to one allows the use of several HR instructions on a single HR pin. Only
one instruction is allowed to operate in HR mode (bit cleared to 0), but the other instructions can be used
in standard resolution mode (bit set to 1).