SPRUJF2A March 2026 – March 2026 AM13E23019
In fill mode (DMAEM = 2h), the DMA module takes a predefined FILL value/pattern and writes this to a user defined segment of memory. The DMATM register setting is ignored and the "block transfer" mode is used automatically. The intended use case for this mode is to initialize or re-initialize a memory buffer with values (for example all zeros or incrementing data) using the DMA, without the need for a software loop doing each write individually via the CPU.
In other modes, the 32-bit value programmed to the DMASA register is used as a pointer to a memory location, whereas in FILL mode, the value programmed to the DMASA register is used directly as the FILL data. The DMASRCINCR bit field is used to indicate whether the FILL data remains constant or is incremented/decremented with every write cycle. This feature allows for filling a memory block with a sequential pattern. The DMASRCWDTH bit field indicates the magnitude to increment of the FILL mode data. Refer to Table 9-7 for how to use DMASRCWDTH in fill mode.
The benefit of doing this operation using FILL mode (DMAEN=2) rather than normal mode with block transfer configured (DMAEN=2, DMATM=1), is that FILL mode has an improved performance due to the fact that the transfer of each individual element in normal mode requires the DMA to read and write, whereas in FILL mode, the fill data is stored inside the DMASA register, so each element only requires a write operation.
| DMASRCWDTH | FILL Mode Data Increment Value |
|---|---|
| 0 | ±1 |
| 1 | ±2 |
| 2 | ±4 |
| 3 | ±8 |
The channel destination registers and bit fields DMADA, DMADSTINCR, and DMADSTWDTH all behave as expected and influence where and how in memory the FILL pattern is written.