Atmel Evaluation Kit AT91SAM9X35-EK AT91SAM9X35-EK Data Sheet

Product codes
AT91SAM9X35-EK
Page of 1301
940
SAM9X35 [DATASHEET]
11055E–ATARM–10-Mar-2014
42.7.10 Buffer Structure
The DMA read channel is triggered each time a new data is stored in ADC_LCDR register. The same structure of data is
repeatedly stored in ADC_LCDR register each time a trigger event occurs. Depending on user mode of operation
(ADC_MR, ADC_CHSR, ADC_SEQR1, ADC_SEQR2, ADC_TSMR) the structure differs. Each data transferred to DMA
buffer, carried on a half-word (16-bit), consists of last converted data right aligned and when TAG is set in ADC_EMR
register, the 4 most significant bits are carrying the channel number thus allowing an easier post-processing in the DMA
buffer or better checking the DMA buffer integrity.
As soon as touchscreen conversions are required, the pen detection function may help the post-processing of the buffer.
To get more details refer to 
42.7.10.1 Classical ADC Channels Only
When no touchscreen conversion is required (i.e. TSMODE = 0 in ADC_TSMR register), the structure of data within the
buffer is defined by the ADC_MR, ADC_CHSR, ADC_SEQR1, ADC_SEQR2 registers. 
If the user sequence is not used (i.e. USEQ is cleared in ADC_MR register) then only the value of ADC_CHSR register
defines the data structure. For each trigger event, enabled channels will be consecutively stored in ADC_LCDR register
and automatically transferred to the buffer.
When the user sequence is configured (i.e. USEQ is set in ADC_MR register) not only does ADC_CHSR register modify
the data structure of the buffer, but ADC_SEQR1, ADC_SEQR2 registers may modify the data structure of the buffer as
well.
Figure 42-12.  Buffer Structure when TSMODE = 0
42.7.10.2 TouchScreen Channels Only
When only touchscreen conversions are required (i.e. TSMODE differs from 0 in ADC_TSMR register and ADC_CHSR
equals 0), the structure of data within the buffer is defined by the ADC_TSMR register.
When TSMODE = 1 or 3, each trigger event adds 2 half-words in the buffer (assuming TSAV = 0), first half-word being
XPOS of ADC_XPOSR register then YPOS of ADC_YPOSR register. If TSAV/TSFREQ differs from 0, the data structure
remains unchanged. Not all trigger events add data to the buffer.
When TSMODE = 2, each trigger event adds 4 half-words to the buffer (assuming TSAV=0), first half-word being XPOS
of ADC_XPOSR register followed by YPOS of ADC_YPOSR register and finally Z1 followed by Z2, both located in
ADC_PRESSR register.
Base Address (BA)
BA + 0x02
ADC_CDR6
6
ADC_CDR5
5
ADC_CDR8
8
BA + 0x04
ADC_CDR6
6
ADC_CDR5
5
ADC_CDR8
8
BA + 0x06
BA + 0x08
BA + 0x0A
ADC_CDR6
6
ADC_CDR5
5
ADC_CDR8
8
BA + [(N-1) * 6]
BA + [(N-1) * 6]+ 0x02
BA + [(N-1) * 6]+ 0x04
Assuming ADC_CHSR = 0x000_01600 
ADC_EMR(TAG) = 1
trig.event1
ADC_CDR6
0
ADC_CDR5
0
ADC_CDR8
0
ADC_CDR6
0
ADC_CDR5
0
ADC_CDR8
0
ADC_CDR6
0
ADC_CDR5
0
ADC_CDR8
0
Assuming ADC_CHSR = 0x000_01600 
ADC_EMR(TAG) = 0
DMA Buffer
Structure
DMA Buffer
Structure
trig.event2
trig.event1
trig.event2
trig.eventN
trig.eventN
DMA Transfer