background image

 

PSoC 6 MCU Voice Recorder 

www.cypress.com

 

Document Number: 002-22221 Rev. *C 

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 

AK4954A

, an audio jack, a digital microphone, and a 

Newhaven 2.4-

inch 240x320 TFT LCD

 display with a 

Sitronix ST7789

 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. 

Figure 2

 

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 

µGUI

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 (

S25FL512S

).  

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

Figure 3

 shows the overall transfers performed by the application. 

Summary of Contents for PSoC 6 MCU

Page 1: ...audio data captured by the microphone is stored to an external flash memory After the recording is completed you can play the audio data over Inter IC Sound I2 S which interfaces with an audio codec Y...

Page 2: ...merican Headset Jack Operation 1 Connect the CY8CKIT 028 TFT shield to the Pioneer Kit 2 Connect a headphone or speaker to the audio jack on the CY8CKIT 028 TFT 3 Connect the Pioneer Kit to your PC us...

Page 3: ...TN0 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 pe...

Page 4: ...rding playing events 4 GraphicsTask handles updates and draws on the LCD Other RTOS elements used for synchronization and communication are 1 Event Queue used to notify EventsTask when specific events...

Page 5: ...PDM_DATA PDM Data input Digital Output Pin PDM_CLK PDM Clock output Digital Output Pin TX_SDO I2S TX Data output Digital Output Pin TX_SCK I2S TX Clock output Digital Output Pin TX_WS I2S TX Word Sel...

Page 6: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 6 Figure 4 PDM PCM Configuration Window...

Page 7: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 7 Figure 5 SMIF Tool Configuration...

Page 8: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 8 Figure 6 DMA_Record Configuration Window Figure 7 DMA_PlayLeft Configuration Window...

Page 9: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 9 Figure 8 DMA_PlayRight Configuration Window...

Page 10: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 10 Figure 9 I2S Configuration Window...

Page 11: ...PSoC 6 MCU Voice Recorder www cypress com Document Number 002 22221 Rev C 11 Figure 10 CapSense Configuration Window Basic Figure 11 CapSense Configuration Window Advanced General...

Page 12: ...Voice Recorder www cypress com Document Number 002 22221 Rev C 12 Figure 12 CapSense Configuration Windows Advanced CSD and CSX Settings Figure 13 CapSense Configuration Window Advanced Widget detail...

Page 13: ...oice Recorder www cypress com Document Number 002 22221 Rev C 13 Figure 14 through Figure 16 shows the changes made in the clock configuration Figure 14 Source Clocks Configuration Figure 15 FLL PLL C...

Page 14: ...the Design Wide Resources Pins settings as needed In some cases a resource used by a code example for example an IP block is not supported on another device In such cases the example will not work If...

Page 15: ...ave operation configurations PDM to PCM Decoder Component Converts a PDM signal to PCM Direct Memory Access DMA Component Transfers data to and from memory and registers Capacitive Sensing CapSense Co...

Page 16: ...mber 002 22221 Revision ECN Orig of Change Submission Date Description of Change 6001270 RLOS 01 05 2018 New code example A 6261637 RLOS 06 26 2018 Added a few acronyms Fixed some minor typos Added So...

Page 17: ...are or software products Cypress shall have no liability arising out of any security breach such as unauthorized access to or use of a Cypress product CYPRESS DOES NOT REPRESENT WARRANT OR GUARANTEE T...

Reviews: