PSoC 6 MCU Voice Recorder
Document Number: 002-22221 Rev. *C
3
Vol: 91%
0:01
9. Listen to the recorded audio using the headphone or speaker. You can pause/resume any time by pressing the right
CapSense button again. If paused, the following screen appears on the LCD:
Vol: 91%
0:07
10. To change the volume, slide your finger on the CapSense slider to the right (increase volume) or to the left (decrease
volume).
Design and Implementation
The CY8CKIT-028-TFT shield contains the audio codec
, an audio jack, a digital microphone, and a
display controller. This allows you to record audio using the microphone
and play it with the audio codec. The display is used to report the current state of the voice recorder
– IDLE, RECORDING,
PLAYING, or PAUSED. The Pioneer kit contains two CapSense buttons and a slider. The buttons trigger the actions supported
by the voice recorder.
shows how the transitions between states occur.
Figure 2. States and Transitions
IDLE
RECORDING
PLAYING
PAUSED
BTN0 : Record Button
BTN1 : Play Button
BTN0
BTN0
BTN1
BTN1
BTN1
BTN1
BTN0
BTN0
Each state is linked to a different icon displayed in the LCD. The Operation section shows the screenshots of each state. The
screen also shows the current volume in percent, and the time duration of the record/play. The GraphLCDIntf Component drives
the LCD. It is configured to have an 8-bit wide bus. The example uses an open-source graphics library for embedded system
called
. The firmware uses this library to draw text and figures on the LCD display.
When recording, the PDM/PCM hardware block captures the data from the digital microphone. All the data written to its internal
FIFO is transferred (using DMAs) to a circular buffer placed in the SRAM. The DMA is configured to generate interrupts when a
certain amount of data is transferred. On each interrupt, the application transfers data from the circular buffer to the external
memory over QuadSPI (SMIF). This memory is placed on Pioneer Kit and uses NOR flash technology (
When playing, the I
2
S hardware block streams the recorded data. The application reads the data from the external memory and
places it in a ping-pong buffer. While writing in the ping buffer, a DMA controller transfers the data from the pong buffer to the
I
2
S TX FIFO.