
GR716-DS-UM, May 2019, Version 1.29
261
www.cobham.com/gaisler
GR716
to generate an interrupt after each transfer or at the end of the transfer. In this example we only gener-
ate an interrupt when all samples has been transfered in order to minimize the interrupt load.
In order to accomplish this we need to:
•
Setup timer and ADC according to chapter 12.2.3
•
Setup the DMA controller channel to respond to interrupt from ADC controller
•
Program the DMA controller to read sample from fixed address when interrupt occur
•
Program the DMA controller to write sample using incremental address
The correct sequence should be as the following address and data table:
TABLE 310. Example of transferring data from ADC to local processor memory using DMA
Address
Data
Description
...
...
0x80050018
0x00000009
ADC0 - Mask register (Enable events from ADC0)
0x8005000C
0x00000800
ADC0 - Select trigger (counter 2 in timer unit 1)
0x80500008
0xB0000000
ADC0 - Sequencer control (Enable synchronization to ext trigger,
continuously enabled)
0x80500004
0x000000FF
ADC0 - Sampling configuration (Oversampling, no consecutive)
0x80500000
0x00081
ADC0 - Configuration (Speed, Channel, Enable)
---
0x80200080
0x01000
Channel Vector - Channel 0 M2B descriptor chain pointer
0x80200084
0x01040
Channel Vector - Channel 0 B2M descriptor chain pointer
...
...
0x01000
0x01023
M2B conditional descriptor 0 - next descriptor pointer (lsb set to 1
for cond. desc.)
0x01004
0x0000001C
M2B conditional descriptor 0 - address (ADC0 Interrupt register
address)
0x01008
0x00040013
M2B conditional descriptor 0 - control (conditional trigger enable,
get 4 Byte)
0x0100C
0x00000009
M2B conditional descriptor 0 - mask (check “End of Conversion” and
"End of sequence" )
0x01010
0x00000009
M2B conditional descriptor 0 - data (check “End of Conversion” and
"End of sequence")
0x01014
0x0000001C
M2B conditional descriptor 0 - ADC0 event to trigger GRDMAC0
0x01018
0x00040004
M2B conditional descriptor 0 - Transfer 4 samples and configure re-
try to 8
0x0101C
0x80005A5A
M2B conditional descriptor 0 - Protection bits for checking DMA
descriptor
...
...
0x01020
0x00000002
M2B data descriptor 0 - next descriptor pointer (NULL, end of chain)
0x01024
0x80500010
M2B data descriptor 0 - address (DMA status register address)
0x01028
0x00040015
M2B data descriptor 0 - control (4 Bytes from fixed address)
0x0102C
-
M2B data descriptor 0 - status (written by core)
...
...
0x01040
0x00000000
B2M data descriptor 0 - next descriptor pointer (NULL, end of chain)
0x01044
0x02000
B2M data descriptor 0 - address (DMA write address for ADC data)
0x01048
0x00040001
B2M data descriptor 0 - control (4 Bytes, Increment address)
0x0104C
-
B2M data descriptor 0 - status (written by core)
...
...
0x02000
-
ADC data written by the DMA controller
0x02004
-
..
0x02008
-
..
0x0200C
-
..
0x02010
-
..
0x02014
-
..
0x02018
-
..
0x0201C
-
..
...
...
0x01080
0x01000
Channel Vector - Channel 0 M2B descriptor chain pointer
0x01084
0x01040
Channel Vector - Channel 0 B2M descriptor chain pointer