Examples
1182
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
High-End Timer Transfer Unit (HTU) Module
After some time the CPU intends to read buffer B:
B1
CPU enables CP A and disables CP B by writing to the CPENA register. After this
switch, the HTU fills buffer A. Filling buffer A starts with its initial full address and initial
frame counter.
B2
CPU waits for CP B busy bit equals 0
B3
Optional: CPU verifies that the CP B request lost flag is not set. The bus error flag of CP
B could also be checked.
B4
CPU reads the frozen CFTCTB, which indicates the fill level in the buffer
B5
CPU sets current CP B (CFTCTB and/or CFADDRB) to 0. This allows to find out if any
request has happened during the next time buffer B is active.
B6
CPU reads BFINTFL flag of buffer B
B7
CPU clears the BFINTFL flag of buffer B. This is an initialization for the next time buffer
B is used.
B8
CPU reads valid values of frozen buffer B. After reading the CPU does not need to clear
the frozen buffer B.
After some time the CPU intends to read buffer A:
A1) ... see above...
NOTE:
The buffer full interrupt doesn't need to be enabled. The BFINTFL flag is used to indicate a
circular overrun of the buffer. If the BFINTFL flag is set, also the buffer section after the
frozen full address could be read.
Steps A3 and B3 in the example sequence above imply that request lost interrupts are disabled. The
example below assumes that request lost interrupts are enabled.
Request lost detection with interrupt enabled.
24.6.3 Example of an Interrupt Dispatch Flow for a Request Lost Interrupt
•
A request lost occurs and the interrupt routine starts.
•
Reading INTOFFx.INTYPEx shows that RLOSTFL is the interrupt source.
•
Reading INTOFFx.CPOFFx = Ah shows that DCP 5 / CP A has caused the RLOSTFL interrupt. The
hardware automatically clears bit (2·5+0) in RLOSTFL.
•
Reading RLOSTFL= 84h shows that also another request lost event happened on DCP 1 / CP A [bit
(2·1+0)] and on DCP 3 / CP B [bit (2·3+1)] at the same time or after the request lost occurred on DCP
5 / CP A.
•
Writing back 84h to RLOSTFL clears bits 2 and 7 and the according pending interrupts.