CE225786 – PSoC 6 MCU: USB Audio
Recorder
Document Number: 002-25786 Rev. **
1
Objective
This example demonstrates the use of PSoC
®
6 MCU to implement an audio recorder using the USB Audio Device Class.
Requirements
™ IDE 1.0
Programming Language:
C
Associated Parts:
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
, 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 the
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
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”.