Data Sheet

290
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181G–SAM-D21_Datasheet–09/2015
CRC module in DMAC supports two commonly used CRC polynomials: CRC-16 (CRC-CCITT) and CRC-32 (IEEE
802.3).
z CRC-16:
z Polynomial: x
16
+ x
12
+ x
5
+1
z Hex value: 0x1021
z CRC-32:
z Polynomial: x
32
+x
26
+x
23
+x
22
+x
16
+x
12
+x
11
+x
10
+x
8
+x
7
+x
5
+x
4
+x
2
+x+1
z Hex value: 0x04C11DB7
The data source for the CRC module must be selected in software as either the DMA channels or the APB bus interface.
The CRC module then takes data input from the selected source and generates a checksum based on these data. The
checksum is available in the CRC Checksum register (CRCCHKSUM). When CRC-32 polynomial is used, the final
checksum read is bit reversed and complemented, as shown in Figure 19-16 on page 290.
The CRC polynomial to be used is configurable, and the default setting is CRC-16. The CRC module operates on byte
only. When the DMA is used as data source for the CRC module, the DMA channel beat size setting will be used. When
used with APB bus interface, the application must set the CRC Beat Size bit field of CRC Control register
(CRCCTRL.CRCBEATSIZE). 8-, 16- or 32-bit bus transfer access type is supported. The corresponding number of bytes
will be written in the CRCDATAIN register and the CRC module will operate on the input data in a byte by byte manner.
Figure 19-16.CRC Generator Block Diagram
CRC on DMA data: CRC-16 or CRC-32 calculations can be performed on data passing through any DMA channel. Once
a DMA channel is selected as the source, the CRC module will continuously generate the CRC on the data passing
through the DMA channel. The checksum is available for readout once the DMA transaction is completed or aborted. A
CRC can also be generated on SRAM, Flash or I/O memory by passing these data through a DMA channel. If the latter
is done, the destination register for the DMA data can be the data input (CRCDATAIN) register in the CRC module.
CRC using the I/O interface: Before using the CRC module with the I/O interface, the application must set the CRC
Beat Size bits in the CRC Control register (CRCCTRL.CRCBEATSIZE). 8/16/32-bit bus transfer type can be selected.
168 8 32
Checksum
read
crc32
CRCCTRL
CHECKSUM
bit-reverse +
complement
CRC-16 CRC-32
DMAC
Channels
CRCDATAIN