Examples
1015
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer Transfer Unit (HTU) Module
21.6 Examples
21.6.1 Application Examples for Setting the Transfer Modes of CP A and B of a DCP
Table 21-50. Application Examples for Setting the Transfer Modes of CP A and B of a DCP
CP A
CP B
One shot
Not used
Buffer A can be used as a "one shot" buffer. A buffer full interrupt enabled for CP A
can signal reaching the end of the buffer.
Auto switch
One shot
Can double the buffer size for a "one shot" buffer. A buffer full interrupt enabled for CP
B can signal reaching the end of the buffer.
Circular
Circular
The CPU can switch the buffers at arbitrary times. It will fill or read the frozen buffer
during the other buffer is filled or read by the HTU. Interrupts are not required for this
case.
Auto switch
Auto switch
Buffer full interrupts (enabled for CP A and B) signal when the end of a buffer is
reached. After one buffer is completed the according CPU interrupt routine will read or
refill this buffer. At the same time the other buffer is read or filled by the HTU. Here the
time when the buffer must be read is determined by the time of the interrupt
(determined by the frequency of the N2HET transfer requests).
21.6.2 Software Example Sequence Assuming Circular Mode for Both CP A and B
The example assumes the N2HET address to be read and the main memory address to be written.
I1
CPU initializes initial DCP: IFADDRA, IFADDRB, IHADDRCT, ITCOUNT
I2
CPU clears current DCP: CFADDRA, CFADDRB, CFTCTA, CFTCTB
I3
CPU clears BFINTFL flag of CP A and B
I4
Enable CP A with the CPENA register. Now the HTU fills buffer A
After some time the CPU intends to read buffer A:
A1
CPU enables CP B and disables CP A by writing to the CPENA register. After this
switch, the HTU fills buffer B. Filling buffer B starts with its initial full address and initial
frame counter.
A2
CPU waits for CP A busy bit equals 0
A3
Optional: CPU verifies that the CP A request lost flag is not set. The bus error flag of CP
A could also be checked.
A4
CPU reads the frozen CFTCTA, which indicates the fill level in the buffer
A5
CPU sets current CP A (CFTCTA and/or CFADDRA) to 0. This allows to find out if any
request has happened during the next time buffer A is active.
A6
CPU reads BFINTFL flag of buffer A
A7
CPU clears the BFINTFL flag of buffer A. This is an initialization for the next time buffer
A is used.
A8
CPU reads valid values of frozen buffer A. After reading the CPU does not need to clear
the frozen buffer A.