Texas Instruments Development Kit for TM4C129x,Tiva™ ARM® Cortex™ -M4 Microcontroller DK-TM4C129X DK-TM4C129X 데이터 시트

제품 코드
DK-TM4C129X
다운로드
페이지 2182
To cancel a non-blocking read, the EPIRPSTDn register is cleared. Care must be taken, however
if the register set was active to drain away any values read into the NBRFIFO and ensure that any
read in progress is allowed to complete.
To ensure that the cancel is complete, the following algorithm is used (using the EPIRPSTD0 register
for example):
EPIRPSTD0 = 0;
while ((
EPISTAT
& 0x11) == 0x10)
; // we are active and busy
// if here, then other one is active or interface no longer busy
cnt = (
EPIRADDR0
– original_address) / EPIRSIZE0; // count of values read
cnt -= values_read_so_far;
// cnt is now number left in FIFO
while (cnt--)
value = EPIREADFIFO; // drain
The above algorithm can be optimized in code; however, the important point is to wait for the cancel
to complete because the external interface could have been in the process of reading a value when
the cancel came in, and it must be allowed to complete.
11.3.3
DMA Operation
The µDMA can be used to achieve maximum transfer rates on the EPI through the NBRFIFO and
the WFIFO. The µDMA has one channel for write and one for read. For writes, the EPI DMA Transmit
Count (EPIDMATXCNT) 
register is programmed with the total number of transfers by the µDMA.
An equivalent value is programmed into the DMA Channel Control Word (DMACHCTL) register
of the uDMA at offset 0x008. A µDMA request is asserted by the EPI WRFIFO when the
TXCNT
value of the EPIDMATXCNT register is greater than zero and the
WTAV
bit field of the EPIWFIFOCNT
register is less than the programmed threshold trigger,
WRFIFO
, of the EPIFIFOLVL register. The
write channel continues to write data until the
TXCNT
value in the EPIDMATXCNT register is zero.
Note:
When the
WRFIFO
bit in the EPIFIFOLVL register is set to 0x4 and the application bursts
four words to an empty FIFO, the WRFIFO trigger may or may not deassert depending on
if all four words were written to the WRFIFO or if the first word was passed immediately to
the function requiring it. Thus, the application may not see the
WRRIS
bit in the EPIRIS
register clear on a burst of four words.
The non-blocking read channel copies values from the NBRFIFO when the NBRFIFO is at the level
specified by the EPIFIFOLVL register. For non-blocking reads, the start address, the size per
transaction, and the count of elements must be programmed in the µDMA. Note that both non-blocking
read register sets can be used, and they fill the NBRFIFO such that one runs to completion, then
the next one starts (they do not interleave). Using the NBRFIFO provides the best possible transfer
rate.
For blocking reads, the µDMA software channel (or another unused channel) is used for
memory-to-memory transfers (or memory to peripheral, where some other peripheral is used). In
this situation, the µDMA stalls until the read is complete and is not able to service another channel
until the read is done. As a result, the arbitration size should normally be programmed to one access
at a time. The µDMA controller can also transfer from and to the NBRFIFO and the WFIFO using
the µDMA software channel in memory mode, however, the µDMA is stalled once the NBRFIFO is
851
December 13, 2013
Texas Instruments-Advance Information
Tiva
TM4C129XNCZAD Microcontroller