
GR716-DS-UM, May 2019, Version 1.29
260
www.cobham.com/gaisler
GR716
ter, and the result of this operation will only show the value of the “Receiver FIFO half-full” field in
the status register. This will enable the conditional register to stop polling when this bit becomes ‘1’.
At this point the data descriptor will be executed for the amount of bytes specified in the conditional
descriptor, which in this case is 1 bytes (half of the FIFO size). For the data transfer to read and accu-
mulate correct data, the core must perform a single-byte access. The UART data register contains only
one byte of relevant data. The size limit per transfer is therefore 1 byte and the address is marked as
fixed, so the core will not increment it after every transfer.
The polling counter for the conditional descriptor is set according to the UART speed. If the UART
baud rate is 38.4K and the system frequency is 100 MHz, one can assume that there is going to be 1
Byte available in the UART every 26k clock cycles. Setting the polling period to a value less than 26K
will let the DMA get all the characters from the UART without missing any. The conditional counter
reset value is set to its maximum, a period of 4095 clock cycles (0xFFF).
The polling will restart after the last read and the transfers will go on until the total size specified in
the data descriptor is reached. At this point the M2B chain is completed and the core will proceed with
the B2M chain, emptying the contents of its buffer into memory, at the address specified.
28.9.1 Using the DMA to sample long sequences using conditional descriptor type 1
The build in DMA controller can be used in order to support long autonomous sampling (or low noise
sampling) with out processor intervention.
For this example we extend the previous example in chapter 12.2.3 by using the DMA to transfer 8
samples from the ADC to the local memory before interrupting the processor. The DMA can be pro-
grammed to transfer a pre-defined or infinite number samples. (The software needs to disable the
DMA if infinite transfer mode is enabled and no interrupt). The DMA controller can be programmed
Table 309.
Memory Content
Address
Data
Description
0x40000080
0x40020010
Channel Vector - Channel 0 M2B descriptor chain pointer
0x40000084
0x40020040
Channel Vector - Channel 0 B2M descriptor chain pointer
...
...
0x40020010
0x40020031
M2B conditional descriptor 0 - next descriptor pointer (lsb set to 1 for cond. desc.)
0x40020014
0xCCC00104
M2B conditional descriptor 0 - address (UART status register address)
0x40020018
0x0001FFF1
M2B conditional descriptor 0 - control (poll every 4095 cycles, get 1 Byte)
0x4002001C
0x00000080
M2B conditional descriptor 0 - mask (only check “Receiver FIFO half-full”)
...
...
0x40020030
0x00000000
M2B data descriptor 0 - next descriptor pointer (NULL, end of chain)
0x40020034
0xCCC00100
M2B data descriptor 0 - address (UART data register address)
0x40020038
0x04000011
M2B data descriptor 0 - control (1024 Bytes from fixed address)
0x4002003C
-
M2B data descriptor 0 - status (written by core)
...
...
0x40020040
0x00000000
B2M data descriptor 0 - next descriptor pointer (NULL, end of chain)
0x40020044
0x40000
B2M data descriptor 0 - address (DMA write address for UART data)
0x40020048
0x04000001
B2M data descriptor 0 - control (1024 Bytes)
0x4002004C
-
B2M data descriptor 0 - status (written by core)
...
...
0x40000
-
UART data written by the DMA controller
...
...
0xCCC00200
0x
GRDMAC Control register
0xCCC00204
-
GRDMAC Status register (written by core)
0xCCC00208
0x
GRDMAC interrupt mask register
0xCCC0020C
-
GRDMAC error register
(written by core)
0xCCC00200
0x40000080
GRDMAC channel vector pointer
0xCCC00204
-
Reserved
0xCCC00208
0x
GRDMAC capability register
0xCCC0020C
-
GRDMAC interrupt flag register
(written by core)