SLAAE84 March 2023 MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1
The DMA Ping Pong with ADC example demonstrates how to use the DMA to transfer ADC data between two different buffers, also known as a DMA "Ping Pong". A DMA Ping Pong is commonly used to transfer data to one buffer while the CPU is working with the other buffer. As shown in #GUID-A45EB6DC-89BB-4D62-AA7C-75E01A416B61, the blue path shows the DMA transfers data to Buffer 1 and the CPU gets data from Buffer 2. When the paths switch, the DMA transfers data to Buffer 2 and the CPU gets data from Buffer 1. The benefit to this technique is faster total application runtime because the CPU is free to operate on a section of data at all times. In this example, the ADC is configured in single conversion mode and the DMA and CPU will switch between buffers after each conversion. Download the code for the DMA Ping Pong example.
This application requires the integrated ADC and DMA. The internal VREF is an additional option for the ADC reference, if a different reference value is required.
Sub-block Functionalilty | Peripheral Use | Notes |
---|---|---|
Analog Signal Capture | ADC | Called ADC12_0_INST in code |
Moving memory | DMA | Full featured DMA channel is required to utilize the PREIRQ functionality. The example can be altered to work without the PREIRQ. |
Based on the requirements in Table 1-1, the compatible devices are listed in Table 1-2. The corresponding EVM can be used for quick evaluation.
Compatible Devices | EVM |
---|---|
MSPM0Lx | LP-MSPM0L1306 |
MSPM0Gx | LP-MSPM0G3507 |
Below are the results of the code executing. #GUID-BD943601-7535-42E3-B335-2768FA662317 shows the results of the first buffer after the ADC readings complete. After this point the code will swap the DMA destination to the second buffer and the CPU will now be free to act on the first buffer.
#GUID-7848181A-92A9-4542-8D81-885CBD0B0172 shows the results of the second buffer after the ADC readings complete. The code swaps the DMA destination back to the first buffer and now the CPU can execute on the second buffer.