Instruction Set
943
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
20.6.3.16 PCNT (Period/Pulse Count)
Syntax
PCNT {
[hr_lr={HIGH | LOW}]
[brk={OFF | ON}]
[next={label | 9-bit unsigned integer}]
[reqnum={3-bit unsigned integer}
[request={NOREQ | GENREQ | QUIET}]
[irq={OFF | ON}]
type={FALL2RISE | RISE2FALL | FALL2FALL | RISE2RISE}
pin={pin number}
[control={OFF | ON}]
[prv={OFF | ON}]
[period={25-bit unsigned integer}]
[data={25-bit unsigned integer]
[hr_data= {7-bit unsigned integer}
}
Figure 20-164. PCNT Program Field (P31:P0)
31
26 25
23
22
21
13 12
9
8
7
6
5
4
0
0
Request
Number
BRK
Next program address
0111
Int.
ena
Type select
hr_lr
Pin
select
6
3
1
9
4
1
2
1
5
Figure 20-165. PCNT Control Field (C31:C0)
31
29 28
27
26
25
24
0
Res.
Request
type
Control
Prv.
Period Count
3
2
1
1
25
Figure 20-166. PCNT Data Field (D31:D0)
31
7
6
0
Data
HR Data
25
7
Cycles
One
Register modified
Register A
Description
This instruction detects the edges of the external signal at loop start and
measures its period or pulse duration. The counter value stored in the control
field C[24:0] and in the register A is incremented each N2HET loop. PCNT
uses the HR structure on the pin to measure an HR period/pulse count value.
hr_lr
(Optional) Specifies whether the PCNT instruction captures the HR
delay into the HR data field on the selected edge condition. If hr_lr is
0 (HIGH) then PCNT captures the HR delay. if hr_lr is 1 (LOW) then
PCNT only captures at loop resolution.