To utilize the ping-pong buffering technique, the system must signal the CPU when to begin to access the new data set. After the CPU finishes processing an input buffer (ping), it waits for the EDMA to complete before switching to the alternate (pong) buffer. In this example, both channels provide their channel numbers as their report word and set the EDMA_TPCC_OPT_n[20] TCINTEN bit to generate an interrupt after completion. When channel 15 fills an input buffer, the E15 bit in the interrupt pending register EDMA_TPCC_IPR is set; when channel 12 empties an output buffer, the E12 bit in EDMA_TPCC_IPR is set. The CPU must manually clear these bits. With the channel parameters set, the CPU polls EDMA_TPCC_IPR to determine when to switch. The EDMA and CPU could alternatively be configured such that the channel completion interrupts the CPU. By doing this, the CPU could service a background task while waiting for the EDMA to complete.
Figure 16-47 Ping-Pong Buffering for McASP Example PaRAM Configuration(a) EDMA Parameters for Channel 15 (Using PaRAM Set 15 Linked to Pong Set 64) |
| Parameter Contents | | Parameter | |
| 0010 D000h | | Channel Options Parameter (OPT) | |
| McASP RX Register | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| Channel Destination Address (DST) | | Channel Destination Address (DST) | |
| 0001h | 0000h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4800h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |
(b) Channel Options Parameter (OPT) Content for Channel 15
(c) EDMA Parameters for Channel 12 (Using PaRAM Set 12 Linked to Pong Set 65) |
| Parameter Contents | | Parameter | |
| 0010 C000h | | Channel Options Parameter (OPT) | |
| Channel Source Address (SRC) | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| McASP TX Register | | Channel Destination Address (DST) | |
| 0000h | 0001h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4840h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |
(d) Channel Options Parameter (OPT) Content for Channel 12
Figure 16-48 Ping-Pong Buffering for McASP Example Pong PaRAM Configuration(a) EDMA Pong Parameters for Channel 15 at Set 64 Linked to Set 65 |
| Parameter Contents | | Parameter | |
| 0010 D000h | | Channel Options Parameter (OPT) | |
| McASP RX Register | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| Channel Destination Address (DST) | | Channel Destination Address (DST) | |
| 0001h | 0000h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4820h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |
(b) EDMA Pong Parameters for Channel 12 at Set 66 Linked to Set 67 |
| Parameter Contents | | Parameter | |
| 0010 C000h | | Channel Options Parameter (OPT) | |
| Channel Source Address (SRC) | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| McASP TX Register | | Channel Destination Address (DST) | |
| 0000h | 0001h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4860h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |
Figure 16-49 Ping-Pong Buffering for McASP Example Ping PaRAM Configuration(a) EDMA Ping Parameters for Channel 15 at Set 65 Linked to Set 64 |
| Parameter Contents | | Parameter | |
| 0010 D000h | | Channel Options Parameter (OPT) | |
| McASP RX Register | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| Channel Destination Address (DST) | | Channel Destination Address (DST) | |
| 0001h | 0000h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4800h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |
(b) EDMA Ping Parameters for Channel 12 at Set 67 Linked to Set 66 |
| Parameter Contents | | Parameter | |
| 0010 C000h | | Channel Options Parameter (OPT) | |
| Channel Source Address (SRC) | | Channel Source Address (SRC) | |
| 0080h | 0001h | | Count for 2nd Dimension (BCNT) | Count for 1st Dimension (ACNT) | |
| McASP TX Register | | Channel Destination Address (DST) | |
| 0000h | 0001h | | Destination BCNT Index (DBIDX) | Source BCNT Index (SBIDX) | |
| 0080h | 4840h | | BCNT Reload (BCNTRLD) | Link Address (LINK) | |
| 0000h | 0000h | | Destination CCNT Index (DCIDX) | Source CCNT Index (SCIDX) | |
| 0000h | 0001h | | Reserved | Count for 3rd Dimension (CCNT) | |