background image

 

 

CE225786 – PSoC 6 MCU: USB Audio 

Recorder 

 

 

 

 

 

 

 

www.cypress.com

 

Document Number: 002-25786 Rev. ** 

Objective 

This example demonstrates the use of PSoC

®

 6 MCU to implement an audio recorder using the USB Audio Device Class. 

 

Requirements 

Tool:

 

ModusToolbox

™ IDE 1.0 

Programming Language: 

Associated Parts:

 All 

PSoC 6 MCU

 parts with USB 

Related Hardware: 

PSoC 6 Wi-Fi-BT Pioneer Kit, PSoC 6 Wi-Fi-BT Proto Board

 

Overview 

This code example shows how to stream audio data to a PC over USB using a PSoC 6 device. It uses digital microphones with 
the pulse-density modulation (PDM) to pulse-code modulation (PCM) converter hardware block. All the audio data captured by 
the microphones are streamed over USB Full-Speed (USBFS) using the Audio Device Class. An audio recorder software tool, 
such as 

Audacity

running on a PC initiates the streaming of audio data. 

Figure 1

 shows the high level-block diagram of this application. 

Figure 1. Block Diagram 

PSoC 6 USB Audio Recorder

Arm® Cortex® -

M4 MCU

PDM/PCM

USBFS

2

Digital 

Microphones

Computer

 

The PDM/PCM interface requires two wires 

– PDM Clock and PDM Data. Up to two digital PDM microphones can share the 

same PDM data line. One microphone samples in the falling edge and the other in the rising edge. 

This code example uses FreeRTOS. Visit th

FreeRTOS website

 for documentation and API references of FreeRTOS.

 

Hardware Setup 

This example does not require any additional hardware to run.  

Note

: The PSoC 6 WiFi-BT Pioneer kit ships with KitProg2 installed. ModusToolbox only works with KitProg3. Before using this 

code example, make sure that the kit is upgraded to KitProg3. See ModusToolbox 

Help

 > 

ModusToolbox IDE Documentation

 

User Guide,

 Section 

PSoC 6 MCU KitProg Firmware Loader

. If you do not upgrade, you 

will see an error like “unable to find 

CMSIS-

DAP device” or “KitProg firmware is out of date”.

 

 

Operation 

1.  Connect the kit board to your PC using the provided USB cable through the USB connector. 

2.  Import the application projects into a new workspace or an existing one. See 

KBA225201

3.  Program the PSoC 6 MCU device. In the project explorer, select the 

mainapp

 project. In the Quick Panel, scroll to the 

Launches

 section and click 

Program (KitProg3) 

configuration. 

4.  Connect another USB cable (or reuse the same cable used to program the kit) to the USB Device connector [J28 for 

CY8CKIT-062-WiFi-BT and J10 for CY8CPROTO-062-4343W]. 

5.  In the PC, verify that a new USB device was enumerated as a Microphone and 

named as “PSoC 6 USB Audio Recorder”. 

Summary of Contents for CE225786

Page 1: ...e PDM data line One microphone samples in the falling edge and the other in the rising edge This code example uses FreeRTOS Visit the FreeRTOS website for documentation and API references of FreeRTOS...

Page 2: ...red to the USB data endpoint buffer Figure 2 shows the overall transfers performed by the application Figure 2 Overall Transfers PDM PCM RX FIFO SRAM PCM Buffer USB Data Endpoint Buffer DMA Transfers...

Page 3: ...er an entire audio frame per trigger It triggers when there is enough data in the PDM PCM FIFO Once it completes a transfer it disables itself it is enabled again only when the Audio IN Endpoint Callb...

Page 4: ...Table 1 lists the ModusToolbox resources used in this example and how they are used in the design For pin usage and configuration open the Pins tab of the design modus file Table 1 ModusToolbox Resou...

Page 5: ...PSoC 6 MCU USB Audio Recorder www cypress com Document Number 002 25786 Rev 5 Figure 5 USBFS Configuration...

Page 6: ...hows the configuration settings for DMA_PCM Figure 6 DMA_PCM Configuration Figure 8 and Figure 8 show the platform system clock configuration Note that the FLL and PLL are used in this application The...

Page 7: ...ings Figure 9 High Frequency Clocks Configuration KIT_UART uses the default configuration for UART The following middleware libraries are used in this project FreeRTOS v10 0 1 Retarget I O USB Device...

Page 8: ...PSoC 6 MCU devices and how to build your first PSoC project AN215656 PSoC 6 MCU Dual Core CPU System Design Describes the dual CPU architecture in the PSoC 6 MCU and shows how to build a simple dual C...

Page 9: ...com Document Number 002 25786 Rev 9 Document History Document Title CE225786 PSoC 6 MCU USB Audio Recorder Document Number 002 25786 Revision ECN Orig of Change Submission Date Description of Change...

Page 10: ...of the Software is prohibited TO THE EXTENT PERMITTED BY APPLICABLE LAW CYPRESS MAKES NO WARRANTY OF ANY KIND EXPRESS OR IMPLIED WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE I...

Reviews: