NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

StarterWare Audio Application

From Texas Instruments Wiki
Jump to: navigation, search
{{#switchcategory:MSP430=<McuHitboxHeader/>|C2000=<McuHitboxHeader/>|Stellaris=<McuHitboxHeader/>|TMS570=<McuHitboxHeader/>|MCU=<McuHitboxHeader/>|MAVRK=<MAVRKHitboxHeader/>|<HitboxHeader/>}}

DMA Buffer handling for Ping-Pong Operation[edit]

The StarterWare audio example application uses EDMA for audio data transmit and recieve operations. The audio data buffers associated with EDMA transmission are:

  • 4 Transmit buffers - TX buffer-0, TX buffer-1, TX buffer-2, and a loop buffer.
  • 3 Receive buffers - RX buffer-0, RX buffer-1, and RX buffer-2.

The EDMA paRAM sets are programmed to receive data in RX buffers and transmit data from TX buffers. When an RX buffer gets filled, the contents are be copied to the TX buffer, then it is transmitted. If no data is received, the EDMA paRAM sets for transmission are programmed to transmit from the loop buffer, which is a NULL buffer containing no valid audio data.

Initialization Of EDMA Parameters[edit]

Before the McASP transmit/receive state machines are brought out of reset, the EDMA paRAM sets are initialized. The main paRAM set for RX is paRAM set 0, and the main paRAM set for TX is paRAM set 1. After the main paRAM set expires, data transmission/reception continues on to linked paRAM sets. The linked paRAM sets do not expire since the EDMA copies the linked paRAM set to the main paRAM set and use it for data transfer. Hence, there is no need to update all the fields in a linked paRAM set after the associated transfer completion.

The RX paRAM set 0 is initialized to receive the first audio sample in the RX buffer-0. The transfer completion interrupt is not enabled for paRAM set 0. paRAM set 0 is linked to linked paRAM set 40. The paRAM set 40 resumes receiving data in RX Buffer 0. The paRAM set 40 is linked to paRAM set 41, which is initialized to receive data in RX Buffer 1. The paRAM set 41 is linked back to paRAM set 40. Hence the reception paRAM set is initialized as 0-->40-->41-->40. This linking does not change as the application executes.

All the TX paRAM sets are initialized to transmit from the loop buffer. The transfer completion interrupt is not enabled for paRAM set 1. paRAM set 1 is linked to paRAM set 42. paRAM set 42 and 43 are linked to themselves. Hence transmission paRAM set linking is initialized as 1-->42-->42, 43->43.

StarterWare AudioSlide0.JPG

Releasing the McASP TX and RX state machines from reset[edit]

Once McASP TX and RX state machines are released from reset, the McASP triggers EDMA events for transmit and recieve operations. The first audio sample is received in RX buffer-0 via main paRAM set 0. Since it is linked to paRAM set 40, after receiving the first sample, EDMA resumes receiving data in RX buffer-0 via paRAM set 40. Similarly, the main paRAM set-1 enables transmssion from the loop buffer. When the main paRAM set expires, paRAM set 42 continuously transmits data from the loop buffer.

StarterWare AudioSlide1.JPG

Once the EDMA reception is complete in RX Buffer-0, the application copies the RX Buffer-0 to TX Buffer-0 and updates the link paRAM set 42 to send data from TX Buffer-0. The paRAM set 42 is also linked to paRAM set 43. While the TX buffer-0 is being transmitted, the EDMA receives data in RX buffer-1 via paRAM set 41. Hence the paRAM set 42 is updated to receive data in RX buffer-2.

StarterWare AudioSlide3.JPG

After the RX Buffer-1 is filled, it copies to TX Buffer-1 and the paRAM set 43 is updated to send from TX Buffer-1. After the EDMA transmission from TX Buffer-0 completes, the EDMA immediately starts transmitting from TX Buffer-1 since the paRAM set 42 is linked to paRAM set 43. During this time, the EDMA receives data in RX Buffer-2.

StarterWare AudioSlide4.JPG

After the RX Buffer-2 is filled, it is copied to TX Buffer-2 and the paRAM set 42 is updated to send from TX Buffer-2. After the EDMA transmission from TX Buffer-1 completes, the EDMA immediately starts transmitting from TX Buffer-2 since the paRAM set 43 is linked to paRAM set 42. During this time, the EDMA receives data in RX Buffer-0.

StarterWare AudioSlide5.JPG

After the RX Buffer-0 is filled, it is copied to TX Buffer-0 and the paRAM set 43 is updated to send from TX Buffer-0. After the EDMA transmission from TX Buffer-2 completes, the EDMA immediately starts transmitting from TX Buffer-0 since the paRAM set 42 is linked to paRAM set 43. During this time, the EDMA receives data in RX Buffer-1.

StarterWare AudioSlide6.JPG

The EDMA data transfer resumes in the same sequence as explained in the above steps since the paRAM sets are programmed appropriately.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare Audio Application here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article StarterWare Audio Application here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article StarterWare Audio Application here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article StarterWare Audio Application here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article StarterWare Audio Application here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare Audio Application here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare Audio Application here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article StarterWare Audio Application here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article StarterWare Audio Application here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity

{{#switchcategory:MSP430=<McuHitboxFooter/>|C2000=<McuHitboxFooter/>|Stellaris=<McuHitboxFooter/>|TMS570=<McuHitboxFooter/>|MCU=<McuHitboxFooter/>|MAVRK=<MAVRKHitboxFooter/>|<HitboxFooter/>}}