Datasheet

Timer data in
HET[x]
Loop
Resolution
Clock
Timer data out
HETDIR
HETDIN
HETDOUT
HETDSET
HETDCLR
High Resolution
Structure
N2HET Functional Description
www.ti.com
These 32 I/Os have an identical structure connected to pins HET[31] to HET[0]. See Figure 23-8 for an
illustration of the I/O control. In addition all 32 I/Os have a special HR structure based on the HR clock.
This structure allows any N2HET instruction to use any of these I/Os with an accuracy of either loop
resolution or high resolution accuracy.
Figure 23-8. I/O Control
Pins N2HET [31] to N2HET [0] can be used by the CPU as general purpose inputs or outputs using the
N2HET Data Input Register (HETDIN) for reading and N2HET Data Output Register (HETDOUT), N2HET
Data Set Register (HETDSET) or N2HET Data Clear Register (HETDCLR) for writing, depending on the
type of action to perform. The N2HET pins used as general purpose inputs are sampled on each VCLK2
period.
23.2.5.1 Using General Purpose I/O Data Set and Clear Registers
The N2HET Data Clear Register (HETDCLR) and N2HET Data Set Register (HETDSET) can be used to
minimize the number of accesses to the peripheral to modify the output register and output pins. When the
application needs to set or to reset some N2HET pins pins without changing the value of the others pins,
the first possibility is to read N2HET Data Output Register (HETDOUT), modify the content (AND, OR,
etc.), and write the result into N2HET Data Output Register (HETDOUT). However, this read-modify-write
sequence could be interrupted by a different function modifying the same register which will result in a
data coherency problem.
Using the N2HET Data Set Register (HETDSET) or N2HET Data Clear Register (HETDCLR), the
application program must write the mask value (same mask value for the first option) to the register to set
or reset the desired pins. Any bits written as 0 to HETDSET and HETDCLR are left unchanged, which
avoids the possible coherency problem of the read-modify-write approach.
Coding Example (C program): Set pins using the 2 methods.
unsigned int MASK; /* Variable that content the bit mask */
volatile unsigned int *HETDOUT,*HETDSET; /* Pointer to HET registers */
...
*HETDOUT = *HETDOUT | MASK; /* Read-modify-write of HETDOUT */
*HETDSET = MASK; /* Set the pin without reading HETDOUT */
23.2.5.2 Loop Resolution Structure
The N2HET uses the pins N2HET [31:0] as input and/or output by the way of the instruction set. Actually,
each pin could monitor the N2HET program or could be monitored by the N2HET program. By using the
I/O register of the N2HET, the CPU is able to interact with the N2HET program flow.
When an action (set or reset) is taken on a pin by the N2HET program, the N2HET will modify the pin at
the rising edge of the next loop resolution clock.
When an event occurs on a N2HET I/O pin, it is taken into account at the next rising edge of the loop
resolution clock.
The structure of each pin is shown in Figure 23-9.
946
High-End Timer (N2HET) Module SPNU562May 2014
Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated