Overview
958
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer (N2HET) Module
23.1.8 Instructions Features
The N2HET has the following instructions features:
•
N2HET uses a RISC-based specialized timer micromachine to carry out a set of 30 instructions
•
Instructions are implemented in a Very Long Instruction Word (VLIW) format (96-bits wide)
•
The N2HET program execution is self-driven by external or internal events, branching to special
routines based on input edges or output compares
•
Instructions point to the next instruction executed, eliminating the need for a program counter
•
Several instructions can change the program flow based on internal or external conditions
23.1.9 Program Usage
The N2HET instructions/program can be assembled with the N2HET assembler. The assembler generates
a C-structure which can be included into the main application program. The application has to copy the
content of the structure into the N2HET RAM, set up necessary registers and start the N2HET program
execution. In addition to the C-structure, the assembler generates also a header file which makes it easy
for the main application to access the different instructions and change for example the duty cycle of a
PWM or read out the captured value of a specific signal edge.
23.2 N2HET Functional Description
The N2HET contains RAM into which N2HET code is loaded. The N2HET code is run by the specialized
timer micromachine. The host interface and I/O control provide an interface to the CPU and external pins
respectively.
23.2.1 Specialized Timer Micromachine
The N2HET has its own instruction set, detailed in
. The timer micromachine reads each
instruction from the N2HET RAM. The program and control fields contain the instructions for how the
specialized timer micromachine executes the command. For most instructions, the data field stores the
information that needs to be manipulated.
The specialized timer micromachine executes the instructions stored in the N2HET RAM sequentially. The
N2HET program execution is self-driven by external or internal events. This means that input edges or
output compares may force the program to branch to special routines using a conditional address.
shows some of the major operations that the N2HET can carry out, namely compares,
captures, angle functions, additions, and shifts. The N2HET contains five registers (A, B, R, S, and T)
used to hold compare or counter values and are used by the N2HET instructions. Data may be taken from
the registers or the data field for manipulation; likewise, the data may be returned to the registers or the
data field.
23.2.1.1 Time Slots and Resolution Loop
Each instruction requires a specific number of cycles or time slots to execute. The resolution specified in
the prescaler bitfields determines the timer accuracy. All input captures, event counts, and output
compares are executed once in each resolution loop. HR captures and compares are possible (up to
N2HET clock accuracy) on the HR I/O pins. For more information about the HR I/O structure, see
.