Datasheet
www.ti.com
Instruction Set
irq (Optional) Specifies whether or not an interrupt is generated. A value
of ON sends an interrupt when a new value is captured. If OFF is
selected, no interrupt is generated.
type (Optional) Determines the type of counter that is implemented.
Table 23-66. Counter Type Encoding Format
P7 P6 Period/Pulse Select Reset On Capture On
Count low pulse duration on
FALL2RISE 0 0 Falling edge Rising edge
selected pin
Count high pulse duration on
RISE2FALL 0 1 Rising edge Falling edge
selected pin
Count period between falling
FALL2FALL 1 0 Falling edge Falling edge
edges on selected pin
Count period between rising edges
RISE2RISE 1 1 Rising edge Rising edge
on selected pin
period Specifies the 25-bit integer value that holds the counter value. The
counter value is also stored in register A.
Default: 0.
data 25-bit integer representing the last captured counter value.
Default: 0.
hr_data HR delay.
Default: 0.
If period-measure is selected, PCNT captures the counter value into the period/pulse data field [D31:D7]
on the selected edge. The HR structure provides HR capture field [D6:D0]. The counter value [C24:C0] is
reset on the same edge. The captured period value is a 32-bit value.
If pulse-measure is selected, PCNT captures the counter value into the period/pulse count field [D31:D7]
on the selected edge. The HR structure provides HR capture field [D6:D0]. The counter value [C24:C0] is
reset on the next opposite edge. The captured pulse value is a 32-bit value.
When the overflow count (all 1’s in the counter value) is reached, PCNT stops counting until the next reset
edge is detected.
Note: For FALL2FALL/RISE2RISE, the user should always discard the first interrupt/HTU request if
interrupt/request are enabled before HET_ON. For both the types, reset edge and capture edge are the
same and the interrupt or HTU request is triggered on capture edge (which is nothing but the reset edge).
Once the execution unit is enabled, the first edge generates an interrupt but the value of the counter is of
no use as this is not the period between 2 edges. So first edge after turning on N2HET is used mainly for
resetting the counter and start the period count.
Execution
Z = 0;
If (Period C[24:0] != 1FF_FFFFh) {
Period C[24:0] = Period C[24:0] + 1;
}
Register A = Period C[24:0];
If (specified capture edge detected on selected pin)
{
Z = 1;
1043
SPNU562–May 2014 High-End Timer (N2HET) Module
Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated