13.5.5 Conditional Branch
With DMAxSTA.MATCH taken into account in calculating the next Descriptor Pointer (DP), the operational flow can be made dependent on the content of the payload. This conditionality along with the Descriptor Pointer Offset effectively yields the conditional branch operation, see Table 13-13 and Table 13-14 This can be also used to build programming loops, making DMA much more independent of the CPU in processing the peripheral status bits and the corresponding data transfer.
In a typical DMA operation, the module can be configured to test a status bit using its pattern matching capability upon trigger. Then based on the logic state of the selected bit(s) resulting in DMAxSTA.MATCH which affects the next Descriptor Pointer, it would be able to branch to an appropriate data transfer routine with or without address gaps in between transfers, without any CPU intervention.
| Memory Position | Memory Address Location (DP as a Product of Register Content and Arithmetic Calculation) | Descriptor[31:0] | |||
|---|---|---|---|---|---|
| [31:25] | [24:18] | [17:16] | [15:0] | ||
| 1 | SADDR[23:0] | DPOxM1[6:0] | DPOxM0[6:0] | SIZEx[1:0] | SADDRx[15:0] |
| ... | ... | ... | ... | ... | ... |
| n | SADDR[23:0] = SADDR[23:0] + DPOxM1 if MATCH = 1 else
SADDR[23:0] + DPOxM0 is MATCH = 0 | DPOyM1[6:0] | DPOyM0[6:0] | SIZEy[1:0] | SADDRy[15:0] |
| ... | ... | ... | ... | ... | ... |
| m | SADDR[23:0] = SADDR[23:0] + DPOyM1 if MATCH = 1 else
SADDR[23:0] + DPOyM0 is MATCH = 0 | DPOzM1[6:0] | DPOzM0[6:0] | SIZEz[1:0] | SADDRz[15:0] |
| ... | ... | ... | ... | ... | ... |
|
Note:
| |||||
| Memory Position | Memory Address Location (DP as a Product of Register Content and Arithmetic Calculation) | Descriptor[31:0] | |||
|---|---|---|---|---|---|
| [31:25] | [24:18] | [17:16] | [15:0] | ||
| 1 | DADDR[23:0] | DPOxM1[6:0] | DPOxM0[6:0] | SIZEx[1:0] | DADDRx[15:0] |
| ... | ... | ... | ... | ... | ... |
| n | DADDR[23:0] = DADDR[23:0] + DPOxM1 if MATCH = 1 else
DADDR[23:0] + DPOxM0 is MATCH = 0 | DPOyM1[6:0] | DPOyM0[6:0] | SIZEy[1:0] | DADDRy[15:0] |
| ... | ... | ... | ... | ... | ... |
| m | DADDR[23:0] = DADDR[23:0] + DPOyM1 if MATCH = 1 else
DADDR[23:0] + DPOyM0 is MATCH = 0 | DPOzM1[6:0] | DPOzM0[6:0] | SIZEz[1:0] | DADDRz[15:0] |
| ... | ... | ... | ... | ... | ... |
|
Note:
| |||||
