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.

Table 13-13. Next Source Descriptor Pointer Value Determination(1), (2), (3), (4)
Memory PositionMemory Address Location (DP as a Product of Register Content and Arithmetic Calculation)Descriptor[31:0]
[31:25][24:18][17:16][15:0]
1SADDR[23:0]DPOxM1[6:0]DPOxM0[6:0]SIZEx[1:0]SADDRx[15:0]
..................
nSADDR[23:0] = SADDR[23:0] + DPOxM1 if MATCH = 1 else SADDR[23:0] + DPOxM0 is MATCH = 0DPOyM1[6:0]DPOyM0[6:0]SIZEy[1:0]SADDRy[15:0]
..................
mSADDR[23:0] = SADDR[23:0] + DPOyM1 if MATCH = 1 else SADDR[23:0] + DPOyM0 is MATCH = 0DPOzM1[6:0]DPOzM0[6:0]SIZEz[1:0]SADDRz[15:0]
..................
Note:
  1. Descriptor fetching is subject to memory boundary restriction and address fault detection.
  2. Descriptor fetching is a 32-bit word operation.
  3. SADDR[23:0] indicates a register content.
  4. SADDRn[15:0] indicates a payload pointer value.
Table 13-14. Next Destination Descriptor Pointer Value Determination(1), (2), (3), (4)
Memory PositionMemory Address Location (DP as a Product of Register Content and Arithmetic Calculation)Descriptor[31:0]
[31:25][24:18][17:16][15:0]
1DADDR[23:0]DPOxM1[6:0]DPOxM0[6:0]SIZEx[1:0]DADDRx[15:0]
..................
nDADDR[23:0] = DADDR[23:0] + DPOxM1 if MATCH = 1 else DADDR[23:0] + DPOxM0 is MATCH = 0DPOyM1[6:0]DPOyM0[6:0]SIZEy[1:0]DADDRy[15:0]
..................
mDADDR[23:0] = DADDR[23:0] + DPOyM1 if MATCH = 1 else DADDR[23:0] + DPOyM0 is MATCH = 0DPOzM1[6:0]DPOzM0[6:0]SIZEz[1:0]DADDRz[15:0]
..................
Note:
  1. Descriptor fetching is subject to memory boundary restriction and address fault detection.
  2. Descriptor fetching is a 32-bit word operation.
  3. DADDR[23:0] indicates a register content.
  4. DADDRn[15:0] indicates a payload pointer value.