Getting started with STEVAL-CCA021V1, STM32 performance line USB demonstration kit

User Manual;STEVAL-CCA021V1;TS4657;STM32F103RE;TS2012;UM0722

User, Manual;STEVAL-CCA021V1;TS4657;STM32F103RE;TS2012;UM0722

STMicroelectronics

STEVAL-CCA021V1(2)

STEVAL-CCA021V1 STMicroelectronics - STEVAL-CCA021V1 Оціночні плати - аудіо підсилювачі RX Electronics Limited

2.STEVAL-CCA021V1

STEVAL-CCA021V1 | STMicroelectronics STEVAL-CCA021V1 Stock available from Infinity-Semiconductor.com | STEVAL-CCA021V1 with Best Price at Infinity-Semiconductor.com

STEVAL-CCA021V1 | STMicroelectronics STEVAL-CCA021V1 Stock available from Infinity-Electron.com | STEVAL-CCA021V1 with Best Price at Infinity-Electron.com

PDF preview unavailable. Download the PDF instead.

68-STEVAL-CCA021V1
UM0722 User manual
Getting started with STEVAL-CCA021V1, STM32 performance line USB demonstration kit

1

Introduction

This user manual describes hardware and software of the STMicroelectronicsTM STM32TM performance line USB demonstration kit based on the STM32F103 microcontroller and the I2S TS4657 audio digital to analog converter (decoder). The audio output can be implemented either with the TS4962 driven onboard speaker which output is also available on the onboard mono jack connector, or through TS2012 stereo audio amplifier which can drive external speakers. Both audio amplifiers are Class-D. The audio input is available with an onboard microphone which is connected through TS472 microphone preamplifier to the ADC input of the microcontroller. To facilitate the reuse of the boards, the controller and the audio card can be disconnected, and used separately for other purposes.
This demonstration kit primarily offers a USB interface operating either under USB Audio Device Class for audio streaming, or Device Firmware Upgrade class (DFU) for application reprogramming through the USB. All design information are included in the kit and can be reused for a new development. The demonstration kit allows a quick evaluation of STMicroelectronics low-voltage audio components in Human machine interface (HMI) audio input/output, portable audio equipment, and simple PC USB demonstration kit applications.
Figure 1. STM32F103 USB demonstration kit - top view

August 2009

Doc ID 15867 Rev 1

1/46
www.st.com

Contents
Contents

UM0722

1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2

Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3

Boards key features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4

General system description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5

Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.2 Package contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.3 Software driver installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

6

Boards layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.1 STM32 controller board layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.2 TS4657 audio card layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

7

System setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

7.1 Demonstration kit output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

7.1.1 Onboard speaker configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

7.1.2 External mono speaker or headphone configuration . . . . . . . . . . . . . . . 12

7.1.3 External amplified stereo output configuration . . . . . . . . . . . . . . . . . . . . 13

7.1.4 Lineout output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

7.2 Microphone record-replay mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

8

Connectors of the STM32 performance line controller board . . . . . . . 15

8.1 I2S audio connector P2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

8.2 JTAG connector CN1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

9

Connectors and functionality of the TS4657 audio card . . . . . . . . . . . 17

9.1 I2S audio connector P1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

9.2 Mono jack connector J4 and the onboard speaker U6 . . . . . . . . . . . . . . . 17

9.3 TS2012 stereo output terminal connectors P2, P3 . . . . . . . . . . . . . . . . . 18

9.4 TS4657 stereo DAC output audio RCA connectors J1, J3 . . . . . . . . . . . . 19

2/46

Doc ID 15867 Rev 1

UM0722

Contents

9.5 Microphone functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 9.6 TS4657 stereo audio DAC functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 21 9.7 TS4962 mono Class-D power amplifier functionality . . . . . . . . . . . . . . . . 22 9.8 TS2012 stereo Class-D power amplifier functionality . . . . . . . . . . . . . . . . 23

10

LEDs and buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

10.1 LED indicators on the STM32 controller board . . . . . . . . . . . . . . . . . . . . 25

10.2 LED indicators on the TS4657 audio card . . . . . . . . . . . . . . . . . . . . . . . . 25

10.3 B1 button on the STM32 controller board . . . . . . . . . . . . . . . . . . . . . . . . 25

11

Demonstration kit software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

11.1 Design firmware upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

11.2 USB Audio Device Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

11.3 PC USB demonstration kit and record-replay applications . . . . . . . . . . . 27

11.3.1 PC USB demonstration kit application . . . . . . . . . . . . . . . . . . . . . . . . . . 27

11.3.2 Record-replay application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

11.4 Updating demonstration application in the demonstration kit . . . . . . . . . . 29

12

Test measurement of the audio signal . . . . . . . . . . . . . . . . . . . . . . . . . 30

13

Addendum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Appendix A STM32F103 controller board - BOM . . . . . . . . . . . . . . . . . . . . . . . . . 32

Appendix B STM32F103 controller board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Appendix C TS4657 audio card - artwork prints . . . . . . . . . . . . . . . . . . . . . . . . . 38

Appendix D STM32F103 controller board - schematic . . . . . . . . . . . . . . . . . . . . 40

Appendix E TS4657 audio card - schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Doc ID 15867 Rev 1

3/46

List of tables
List of tables

UM0722

Table 1. Table 2. Table 3. Table 4. Table 5. Table 6. Table 7. Table 8.

I2S audio connector pins description of the STM32 controller board . . . . . . . . . . . . . . . . . 15 JTAG connector pins description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 I2S audio connector pins description of the TS4657 audio card . . . . . . . . . . . . . . . . . . . . . 17 Mono jack connector J4 pins description of the TS4657 audio card . . . . . . . . . . . . . . . . . 18 TS2012 stereo output terminal connectors P2, P3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 TS4657 stereo DAC output audio RCA connectors J1, J3 . . . . . . . . . . . . . . . . . . . . . . . . . 19 Bill of material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Docsument revision history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4/46

Doc ID15867 Rev 1

UM0722
List of figures

List of figures

Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. Figure 21. Figure 22. Figure 23. Figure 24. Figure 25. Figure 26. Figure 27. Figure 28. Figure 29. Figure 30. Figure 31. Figure 32. Figure 33. Figure 34. Figure 35. Figure 36. Figure 37. Figure 38.

STM32F103 USB demonstration kit - top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 STM32F103 USB demonstration kit - block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Device manager window - new USB audio device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 STM32 controller board layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 TS4657 audio card board layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Onboard speaker system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 External mono speaker or headphone system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 External amplified stereo output system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Lineout output system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Microphone record-replay mode system setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 I2S audio connector of the STM32 controller board - schematic . . . . . . . . . . . . . . . . . . . . 15 JTAG connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 JTAG connector CN1 - schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 I2S audio connector of the TS4657 audio card - schematic . . . . . . . . . . . . . . . . . . . . . . . . 17 Mono jack audio connector J4 and the onboard speaker U6 . . . . . . . . . . . . . . . . . . . . . . . 18 TS2012 stereo output terminal connectors P2, P3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 TS4657 stereo DAC output audio RCA connectors J1, J3 . . . . . . . . . . . . . . . . . . . . . . . . . 20 Microphone functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 TS4657 stereo audio DAC functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 TS4962 mono Class-D amplifier functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 TS2012 stereo Class-D amplifier functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Typical I2S waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 TS4657 output versus the I2S input (10 kHz signal reconstruction) . . . . . . . . . . . . . . . . . . 30 TS4657 output versus the I2S input (10 kHz signal reconstruction) - detail . . . . . . . . . . . . 31 Typical output from the Class-D amplifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 STM32F103 controller board - top overlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 STM32F103 controller board - bottom overlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 TS4657 audio card - top layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 TS4657 audio card - bottom layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 TS4657 audio card - top overlay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 TS4657 audio card - bottom overlay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 TS4657 audio card - top layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 TS4657 audio card - bottom layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 STM32F103 controller board - schematic - part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 STM32F103 controller board - schematic - part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 TS4657 audio card - schematic - part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 TS4657 audio card - schematic - part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 TS4657 audio card - schematic - part 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Doc ID 15867 Rev 1

5/46

Description

2

Description

UM0722

The STM32 performance line USB demonstration kit is designed to demonstrate several STMicroelectronics products:
 The TS4657 is a stereo DAC that integrates a high-performance audio line driver capable of generating a 2.2 VRMS output level from a single 3.0 to 5.5 V supply. One single supply is sufficient for the digital and analog parts of the circuit, thus eliminating the need for external regulators. The TS4657 is a low-power consumption device. It features only 22 mW power dissipation at a 3.0 V power supply in full operation. A 16-bit multi-bit sigma delta DAC is used, operating at 256 x Fs (where Fs is the sampling frequency) with oversampling digital interpolation filters. The digital audio data can be 16 to 24-bit long and sample rates from 32 to 48 kHz are supported. The TS4657 is packaged in a small 4 x 4 mm QFN20 package, ideal for portable applications.
 The STM32F103xx performance line family incorporates the high-performance ARM® CortexTM-M3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories (Flash memory up to 128 KB and SRAM up to 20 KB), and an extensive range of enhanced I/Os and peripherals connected to two APB buses. All devices offer two 12-bit ADCs, three general purpose 16-bit timers plus one PWM timer, as well as standard and advanced communication interfaces: up to two I2Cs and SPIs, three USARTs, a USB and a CAN. The STM32F103xx performance line family operates from a 2.0 to 3.6 V power supply. It is available in both the ­40 to +85 °C temperature range and the ­40 to +105 °C extended temperature range. A comprehensive set of powersaving mode allows designing low-power applications. The complete STM32F103xx performance line family includes devices in 5 different package types: from 36 pins to 100 pins.
 The TS2012 is a fully differential stereo Class-D power amplifier able to drive up to 1.15 W into a 8  load at 5 V per channel. It achieves better efficiency compared to typical Class-AB audio amps. Pop and click reduction circuitry provides low on/off switch noise while allowing the device to start within 8 ms.
 The TS4962 is a differential Class-D BTL power amplifier. It is able to drive up to 2.3 W into a 4  load and 1.4 W into a 8  load at 5 V. It achieves outstanding efficiency (88 % typ.) compared to classical Class-AB audio amps. Pop and click reduction circuitry provides low on/off switch noise while allowing the device to start within 5 ms. A standby function (active low) allows to reduce the current consumption down to 10 nA typical.
 The TS472 is a differential-input microphone preamplifier optimized for highperformance, PDA and notebook audio systems. This device features an adjustable gain from 0dB to 40 dB with excellent power-supply and common-mode rejection ratios. In addition, the TS472 has a very low-noise microphone bias generator of 2 V. It also includes a complete shutdown function, with active low standby mode.

6/46

Doc ID 15867 Rev 1

UM0722

3

Boards key features

Boards key features

STM32 performance line controller board  STM32F103 performance line microcontroller  16 MHz crystal unit  USB connector and ESD protection  Two LEDs driven by the microcontroller  Push button to control the firmware mode  Connectors summary
­ 20-pin dual line header for connection to the TS4657 audio card ­ Full JTAG connector
TS4657 audio card  TS4657 - single supply stereo digital audio line driver with 2.2 VRMS capless outputs
­ 16- to 24-bit audio data format stereo DAC, 32 to 48 kHz sample rate ­ I²S, right- or left-justified compatible digital audio interface  TS2012 - filter-free stereo 2 x 2.8 W Class-D audio power amplifier ­ Output available either on the mono jack connector or fed to the onboard speaker  TS4962 - 2.8 W filter-free mono Class-D audio power amplifier ­ Output available either through mono jack connector or to onboard speaker  TS472 - very low noise microphone preamplifier with 2.0 V bias output and active low standby mode ­ Single ended output available for connection to ADC of a microcontroller  Onboard microphone and small speaker  Connectors summary ­ 20-pin dual line header for connection to the STM32 performance line controller
board ­ Two RCA connectors available as TS4657 line outputs ­ Mono jack connector available as TS4962 amplifier output ­ Two terminal connectors available as TS2012 outputs

Doc ID 15867 Rev 1

7/46

General system description

4

General system description

UM0722

The STM32F103 USB demonstration kit consists of two boards. The STM32F103 controller board receives the audio data through USB from PC and transfers them into the I2S data stream in the PCM16 format suitable for the TS4657 audio DAC. In addition, the STM32F103 can act as an interface with a microphone line connected to the microcontroller ADC pin.
The second board performs the audio function, using the TS4657 digital to analog converter (DAC). Its output is passed to TS4962 Class-D mono amplifier that either feeds the onboard speaker or drives the external mono speaker through the onboard mono jack connector. The DAC output is also connected to TS2012 stereo Class-D amplifier which output is available outside the board for external stereo speakers through terminal connectors. The audio input is available through the onboard microphone which output is amplified by TS472 microphone preamplifier. This microphone line is considered to be connected to the ADC input of the microcontroller on the STM32F103 controller board.

Figure 2.

STM32F103 USB demonstration kit - block diagram RCA RCA Stereo lineout

TS4657

TS2012

Connectors
for external speakers

I2S
USB STM32
Analog

Digital control

TS4962 TS472

Onboard speaker
Mono jack for
external speaker
On board microphone
AM00480

8/46

Doc ID 15867 Rev 1

UM0722

5

Getting started

Getting started

5.1

System requirements

In order to use the STM32 performance line USB demonstration kit with the Microsoft® Windows® operating system, a recent version of Windows, such as Windows XP, Windows
98, Windows Millennium or Windows 2000 must be installed on your PC.

The version of the Windows OS installed on your PC may be checked by clicking the "System" icon in the Control Panel.

5.2

Package contents

The STM32 performance line USB demonstration kit includes the following items:
Hardware content  One STM32 controller board with USB and I2S audio connector + one TS4657 audio
card board.  One soldered STM32F103RET6 ARM-based 32-bit microcontroller device (LQFP64
package). It embeds Flash memory allowing 10 thousands reprogramming cycles. (The min. value of the endurance = 10 Kcycles). The STM32F103RET6 is delivered already programmed with the demonstration firmware.
Software content  STM32 Design Firmware Update (DFU) firmware  STM32 DFU application that offers PC USB demonstration kit functionality
Documentation  STM32F103, TS4657IQT, TS2012IQT, TS4962IQT, TS472IQT datasheets  PCB production data  STM32F103 and audio devices flyers  This user manual UM0722

5.3

Software driver installation

The following steps are required to install the software driver of the USB Audio Device Class device:
1. Connect the STM32 performance line USB demonstration kit to your PC/laptop USB port and let the Windows recognize the Audio Device Class device
2. There is no need for any particular user action, just follow installation process and acknowledge default Audio Device Class device driver to operating system once requested. At the end of the installation a new Sound controller appears in the Device Manager window as shown in Figure 3.
This new USB audio device becomes the main audio output for time being.

Doc ID 15867 Rev 1

9/46

Getting started

UM0722

Warning:

Do not place the STM32 performance line USB demonstration kit speaker close to your ears. It might harm your hearing if the card is set to deliver the maximum output power.

Figure 3. Device manager window - new USB audio device

10/46

Doc ID 15867 Rev 1

UM0722

6

Boards layout

6.1

STM32 controller board layout

Figure 4. STM32 controller board layout

Boards layout

6.2

TS4657 audio card layout

Figure 5. TS4657 audio card board layout

Doc ID 15867 Rev 1

11/46

System setup

7

System setup

UM0722

STM32 performance line USB demonstration kit can be used in two application software modes together with at least five audio input / output connection schemes. This chapter gives a brief description of all possible audio hardware settings. The present demonstration kit is designed to be operated always with a personal computer and powered via USB peripheral bus.

Warning:

Do not attach the external speakers when the STM32 performance line USB demonstration kit is powered on, that is when the card is connected via USB with PC. It is recommended to always unplug the card from your PC before connecting or disconnecting the external speakers. Shortcircuiting the power audio amplifier output pins may damage the power audio amplifier output stages.

7.1
7.1.1

Demonstration kit output mode
Onboard speaker configuration
This is the default configuration after the STM32 performance line USB demonstration kit is plugged into the available PC USB port. The green LED LD2 switches on when the demonstration kit is in operating mode. The PC automatically detects the new demonstration kit and all audio outputs are automatically redirected to the new sound device by Windows. For example, play any multimedia content on a media player, and listen to the audio output from the onboard speaker.
Figure 6. Onboard speaker system setup

7.1.2

External mono speaker or headphone configuration
The system setup is the same as for the default onboard speaker mode. Just connect properly the selected external speaker, and follow the instructions given in Section 9.7 LD2 is switched on when the demonstration kit operates in this mode.

12/46

Doc ID 15867 Rev 1

UM0722 Figure 7. External mono speaker or headphone system setup

System setup

7.1.3

External amplified stereo output configuration
To change the audio output from the default onboard speaker to the TS2012 power output, briefly press the B1 button on the controller board. In this mode the red LD1 and the green LD2 are both on. By pressing again the B1 button you can get back to the default onboard speaker mode. Please read Section 9.8 for further information about the best external speaker configuration and limitations of the demonstration kit.
Figure 8. External amplified stereo output system setup

7.1.4

Lineout output configuration
Whatever the firmware application mode, the user can always use lineout RCA stereo interface to obtain standardized audio signal that can be further processed by an external audio equipment.
Figure 9. Lineout output system setup

7.2

Microphone record-replay mode

The onboard microphone can be used only in record-replay mode. To change the operating mode from PC USB demonstration kit to record-replay mode, press B1 for approximately 1 s.

Doc ID 15867 Rev 1

13/46

System setup

UM0722

In this mode the STM32 performance line USB demonstration kit records 5 s long audio sample and than plays it back through any mean (speaker) presented in the above chapter. In this mode, LD2 blinks at a fast rate when the demonstration kit is recording, and at a slower rate when the acquired record is being played back. The red LED LD1 functionality does not change. When LD1 is off the onboard speaker is used for playback, when LD1 is on the external stereo speakers are used.
Figure 10. Microphone record-replay mode system setup

14/46

Doc ID 15867 Rev 1

UM0722

Connectors of the STM32 performance line controller board

8

Connectors of the STM32 performance line controller

board

8.1

I2S audio connector P2

The P2 connector is used to interconnect the STM32F103 controller board and the TS4657 audio card. This connector is functionally compatible with the P1 connector described in Section 9.1.

Table 1. I2S audio connector pins description of the STM32 controller board

Pin

Signal

Pin

Signal

Pin

Signal

Pin

Signal

1 GND

2 +5V0 from USB

3

PA3 pin of the MCU

4

PA2 pin of the MCU

5

PA1 pin of the MCU (ADC)

6 PA0 pin of the MCU

11

PC3 pin of the MCU

7

A3V3 - +3V3 supply voltage for analog domain

12

I2S2_SD, PB15 pin of the MCU

8

I2S2_WS, PB12 pin of the MCU

13

PC2 pin of the MCU

9

VSSA ground for analog domain

10

I2S2_CK, PB13 pin of the MCU

14

I2S2_MCK, PC6 pin of the MCU

15

PC1 pin of the MCU

PB7 pin of the MCU 16 (I2C1_SDA funct. not
used)
Standby for TS4962 17 (onboard speaker and
mono jack)
PB6 pin of the MCU 18 (I2C1_SCL funct. not
used)
19 GND
20 +3V3

Figure 11. I2S audio connector of the STM32 controller board - schematic

A 3.3 V

PA3 PA1
VSSA PC3 PC2 PC1 PC0

P2
12 34 56 78 9 10 11 12 13 14 15 16 17 18 19 20

USB 5 V
PA2 PA0 I2S2_WS I2S2_CK I2S2_SD I2S2_MCK I2C1_SDA I2C1_SCL

Header 10 x 2 S 3.3 V

AM00481

8.2

JTAG connector CN1

The 20-pin connector (CN1) provides the JTAG interface as shown in Figure 12. This interface is primarily used to communicate with a PC using suitable USB/JTAG converter box such as J-Link from IAR SystemsTM or RLink from Raisonance, etc. There exists a wide

Doc ID 15867 Rev 1

15/46

Connectors of the STM32 performance line controller board

UM0722

choice of development tools on the market supporting microcontroller Flash memory programming and application debugging. Figure 12. JTAG connector
2 4 6 8 10 12 14 16 18 20

1 3 5 7 9 11 13 15 17 19

AM00262

Table 2. JTAG connector pins description

Pin Signal Pin Signal Pin

Signal

1 3V3 DC 6 GND

11

RTCK Connected to GND by R1 (10 k)

2 3V3 DC 7 JTMS 12 GND

3 JTRST 8 GND 13 JTDO

4 GND

9 JTCK 14 GND

5 JTDI

10 GND

15 NRST

Pin

Signal

16 GND

17

DBGRQ Connected to GND by R2 (10 k)

18 GND

19

DBGACK Connected to GND by R14 (10 k)

20 GND

Figure 13. JTAG connector CN1 - schematic

CN1 JTAG

3.3 V

1

2

3

JTRST Internal pull-up

4

5

JTDI Internal pull-up

6

7

JTMS Internal pull-up

8

9

JTCK Internal pull-down

10

11

RTCK

R1

12 13

JTDO 10 K

14

15

NRST

16

17

DBGRQ R2 10 K

18

19

DBGACK R14 10 K

20

AM00482

16/46

Doc ID 15867 Rev 1

UM0722

Connectors and functionality of the TS4657 audio card

9

Connectors and functionality of the TS4657 audio

card

9.1

I2S audio connector P1

The P1 connector is used to interconnect the STM32F103 controller board and the TS4657 audio card. This connector is functionally compatible with the P2 connector described in Section 8.1.

Table 3. I2S audio connector pins description of the TS4657 audio card

Pin

Signal

Pin

Signal

Pin

Signal

Pin

Signal

1 GND

6

G1 Gain select for TS2012

11

Right channel mute for TS2012

16

Data format selection FMT2 for TS4657

2 +5V0

7

VCCA +3.3 V

supply voltage for microphone

12

domain

TS4657 SDAT I2S signal

Standby for TS4962 17 (onboard speaker
and mono jack)

3

Microphone shutdown

8

TS4657 LRCLK I2S signal

Left channel 13 mute for
TS2012

18

Data format selection FMT1 for TS4657

4

G0 gain select for TS2012

9

GNDA ground for

TS4657 MCLK

microphone

14 I2S signal

19 GND

domain

(master clock)

5

Analog output from microphone preamplifier

10

TS4657 BCLK I2S signal

15

Standby for TS4657

20 NC

Figure 14. I2S audio connector of the TS4657 audio card - schematic

GND

MICRO_SHDN MICRO_OUT

GNDA

VCCA
STBY_R STBY_L DAC_STBY SPK_STBY

GND

P1
12 34 56 78 9 10 11 12 13 14 15 16 17 18 19 20

5 V
G0 G1 DAC_LRCLK DAC_BCLK DAC_SDAT DAC_MCLK DAC_FMT2 DAC_FMT1

AM00483

9.2

Mono jack connector J4 and the onboard speaker U6

The mono jack audio connector J4 is connected to the output of the TS4962 Class-D mono audio amplifier U3. The amplifier drives either the onboard speaker or the J4 mono jack

Doc ID 15867 Rev 1

17/46

Connectors and functionality of the TS4657 audio card

UM0722

connector if an external speaker is connected. The output is never available to J4 and U6 at the same time because the mono jack connector J4 has the pin disconnection capability.

l
Table 4. Mono jack connector J4 pins description of the TS4657 audio card

Pin

Signal

1 OUT­ line of the TS4962 mono amplifier

2 OUT+ line of the TS4962 mono amplifier (present if the external speaker is connected)

3

OUT+ line of the TS4962 amplifier connected to the pin 2 of the onboard speaker U6 when the external speaker is not connected.

Figure 15. Mono jack audio connector J4 and the onboard speaker U6

300 K

1 STBY

Internal bias

150 K 3 IN+
4 IN­

PWM

150 K

Oscillator

NC 2
ST: TS4962IQT

679

U3

VCCA E-PAD GNDA

OUT+ 5
OUTPUT H
BRIDGE OUT­ 8

Mono jack

Lumberg 1503 06

GND

J4

100 pF

L5

C32

BLM18EG221SN1

L6

BLM18EG221SN1

21 C33 100 pF

GND

U6

KSSG1708
Speaker

AM00484

9.3

TS2012 stereo output terminal connectors P2, P3

The TS2012 stereo Class-D amplifier output is available outside the board through the onboard terminal connectors P2 and P3.

Table 5.

TS2012 stereo output terminal connectors P2, P3

Connector P2

Connector P3

Pin

Signal

Pin

Signal

1

LOUT+

1

ROUT­

2

LOUT­

2

ROUT+

18/46

Doc ID 15867 Rev 1

UM0722

Connectors and functionality of the TS4657 audio card

Figure 16. TS2012 stereo output terminal connectors P2, P3

16 LIN + 17 LIN­ 15 G0

9
AVCC Gain select

PVCC

3 13

U2 ST: TS2012IQT

PVCC

LOUT+ 2

H

PWM

bridge

5

LOUT­

GND

L1
BLM18EG221SN1 L2

100 pF C8
P2
1 2

BLM18EG221SN1

Terminal block
C9 100pF

1 G1

Oscillator

GND

20 RIN + 19 RIN ­

Gain select

7

STBY L Standby

8 STBY R control

AGND 18

PWM

H

ROUT+ 14

bridge

11

ROUT­

L3
BLM18EG221SN1 L4

100 pF C30
P3
2 1

PGND PGND E-PAD

4 12

21

BLM18EG221SN1

Terminal block
C31 100 pF

GND

External speakers

AM00485

9.4

TS4657 stereo DAC output audio RCA connectors J1, J3

The TS4657 stereo DAC audio output is available as lineout signal through the onboard RCA connectors J1, J3.

Table 6.

TS4657 stereo DAC output audio RCA connectors J1, J3

Connector J1

Connector J3

Pin

Signal

Pin

Signal

1

LOUT

1

ROUT

2

GND

2

GND

Doc ID 15867 Rev 1

19/46

Connectors and functionality of the TS4657 audio card

UM0722

Figure 17. TS4657 stereo DAC output audio RCA connectors J1, J3

13 19

18 14

U1

VCCA VCCD NCP

VREGD LDO

PCP

LDO

VREGA

GND

C10 2.2 nF

3 LRCLK
4 SDAT Digital 5 BCLK audio
interface 6 MCLK

Digital filters

DAC DAC

LOUT 12 R4 820 
ROUT 11 R5 820 

7 FMT2 8 FMT1 Control interface
STDBY

GNDA

GNDD

GNDD GNDA GNDA E-PAD

C14 2.2 nF
GND

9

20 2 1 10 15 16 17 21

RCA WBTOR 1 J1
GND
GND J3
RCA WBTOR 1

AM00486

9.5

Microphone functionality

An onboard microphone is available on the TS4657 audio card. The microphone is connected to the microphone preamplifier TS472, which operates in single-ended output configuration. The preamplifier output is available on the I2S audio connector P1 and is connected also to the ADC input pin of the STM32 MCU on the controller board.
The microphone unit U5 is supplied from the TS472 preamplifier 2.0 V bias pin. R11, R12 (1 K) resistors are polarizing resistors for biasing of the microphone. C19 and C20 are input coupling capacitors that block the DC voltage at the amplifier input pins and their value determines also the cut-off of the low input frequencies. C18 and C23 are low pass filter capacitors which allow to cut-off the high frequencies (100 pF ~ 20 kHz). C28 is assembled with 0 resistor in order to have DC coupling between the preamplifier and the STM32 microcontroller. For AC coupling the C28 value determines also the cut-off of the low output frequencies. The preamplifier gain can be changed by different values of the R17 resistor (see TS472 datasheet on www.st.com). In this configuration the gain is fixed to 40 dB. R3 represents the input impedance of the following stage and is also used to charge the output capacitor C28. R3 is assembled in the default configuration but can be safely removed. R15 is not necessary in case the standby pin connection is correctly handled on the side of the microcontroller. TS472 has a weak pull-down resistor already embedded. If there is no connection on the standby pin to the microcontroller, the preamplifier is in the standby mode. The amplifier is powered from +3.3 V coming from the controller board.

20/46

Doc ID 15867 Rev 1

UM0722

Connectors and functionality of the TS4657 audio card

Figure 18. Microphone functionality

VCCA

C18

C27

C17 VCCA 100 nF

100 pF C23

Microphone

1 µF GNDA
U5 2 1

GNDA

R11 1 K

C19

8 IN+

C20 100 nF

5

IN­

20 VCC

15 14 100 pF U4 C1 C2 OUT+ 17
OUT­ 16

GNDA
R3 C28 100 K
MICRO_OUT 0  / 22 nF C28: assembly 0R resistor

KEEG1542PBL

100 nF

R12

G GAIN 9

for DC coupling

1 K

10 Bias

BYPS

Bias

2

R17 68 

GNDA

2.0 V GND GND STBY

C29 1 µF

GNDA

22

4

ST: TS472IQT

GNDA

21

GNDA

MICRO_SHDN

R15 10 K

GNDA

Microphone preamplifier

AM00487

9.6

TS4657 stereo audio DAC functionality

The TS4657 is a stereo digital to analog converter. It is a 16-bit multi-bit sigma delta DAC operating at 256 x audio sample rate with over sampling digital interpolation filters. The digital audio data can be 16 to 24 bit long and sample rates from 32 to 48 kHz are supported.
The digital I2S interface has four lines: LRCLK (left - right channel selection), SDAT (audio data), BCLK (bit clock) and MCLK (master clock - over sampling clock). The selection of the data format can be performed through two pins (FMT1, FMT2). The supported data formats are:
 Right-justified, 16-bit data, Data valid on rising edge of BCLK
 Right-justified, 24-bit data, Data valid on rising edge of BCLK
 Left-justified, 16-bit up to 24-bit data, Data valid on rising edge of BCLK
 I²S, 16-bit up to 24-bit data, Data valid on rising edge of BCLK
The standby mode can be entered by driving the standby pin low. The pin features internal weak pull down resistor. For practical reason there is also an external pull-down resistor R20 which is helpful when utilizing the amplifier with a microcontroller. The same is valid for the format pins (FMT1, FMT2) and pull down resistors R7 and R8. The RC passives R4, R5, C10 and C14 are low pass filter network. The output is referenced to ground. The lineout RCA connectors J1, J3 are available on the board for both audio channels. The DAC is powered from +5 V coming from the controller board. One single supply is sufficient for the digital and analog parts of the circuit, thus eliminating the need for external regulators.

Doc ID 15867 Rev 1

21/46

Connectors and functionality of the TS4657 audio card

UM0722

Figure 19. TS4657 stereo audio DAC functionality

5V 5V

C1

C2

DAC

C3

C4

GND 1 µF

1 µF GND 1 µF

13 19

18

1 µF GND

14

U1

VCCA VCCD NCP

VREGD LDO

VREGA

PCP

LDO

GND

DAC_LRCLK 3 LRCLK

DAC_SDAT 4 DAC_BCLK 5 DAC_MCLK 6

SDAT Digital BCLK audio MCLK interface

Digital filters

DAC_FMT2 DAC_FMT1

7 FMT2 8 FMT1 Control interface

STDBY

DAC

LOUT

DAC

ROUT

GNDA

GNDD

GNDD GNDA GNDA E-PAD

C10 2.2 nF 12 R4 820 
11 R5 820  C14 2.2 nF GND

R7 10 K

R8

9

20 2 1 10 15 16 17 21

10 K

DAC_STBY R20

GND GND

10 K GND

GND

RCA WBTOR 1 J1
GND
GND J3
RCA WBTOR 1
AM00488

9.7

TS4962 mono Class-D power amplifier functionality

The TS4962 is a differential Class-D power amplifier. It is able to drive up to 1.4 W into a 8  load at 5 V. The gain of the device can be controlled via two external gain-setting resistors R14 and R16. The amplifier is configured in single ended input configuration and signaled from the left channel of the TS4657 audio DAC. A standby function (active low) allows switching the amplifier off. As in previous cases there is an internal weak pull down resistor on this standby pin and an external 10 K (R13) resistor connected to the GND which is useful when utilizing the amplifier with a microcontroller. L5, L6, C32, C33 filters increase the EMI when an external speaker is connected through long cables. The amplifier is powered from +5 V coming from the controller board.

22/46

Doc ID 15867 Rev 1

UM0722

Connectors and functionality of the TS4657 audio card

Figure 20. TS4962 mono Class-D amplifier functionality

GND Mono Class-D amplifier

R13

10 K

Input from SPK_STBY

1

the TS4657 left channel

C21

R14

100 nF 150 k 3

C22 R16

4

300 K

STBY

Internal bias

150 K IN+
IN­

PWM

100 nF 150 k

150 K

GND

5 V

Oscillator

C24 1 µF

C25 100 nF

GND GND

ST: TS4962IQT

NC 2

5 V GND

6 79
VCCA E-PAD GNDA

U3 Mono jack
Lumberg 1503 06

GND

J4

OUT+ 5

L5

100 pF C32

OUTPUT

BLM18EG221SN1

H

BRIDGE OUT­ 8

L6

BLM18EG221SN1

21 C33 100 pF

GND

U6

KSSG1708
Speaker

AM00489

Warning:

The maximum output power of the TS4962 mono amplifier is 2.2 W at 5 V into 4  speaker and 1.4 W at 5 V into 8  speaker. Please take into consideration the maximum current of the USB port which is typically 500 mA (2.5 W). When the demonstration kit sinks more current from the USB port, it is automatically disconnected from the PC. If this happens just unplug and plug again your demonstration kit.

9.8

TS2012 stereo Class-D power amplifier functionality

The TS2012 stereo audio Class-D amplifier is connected to the output of the TS4657 audio DAC. The TS2012 input is configured in the single-ended configuration. The amplifier is able to drive up to 1.35 W into a 8  load at 5 V per channel. The device has four different gain settings utilizing two discrete pins: G0 and G1. These pins are controlled by STM32 MCU in the firmware. The gain is set to the minimal value by default thanks to the internal weak pull down resistors. There are also two external pull down resistors R1, R2 which are useful when utilizing the amplifier with a microcontroller. Two standby pins (active low) allow each channel to be switched off independently (internal weak pull down resistors together with external R9 and R10 are present). L1, L2, L3, L4, C8, C9, C30, C31 increase the EMI when the external speakers are connected through long cables. The amplifier is powered from +5 V supplied by from the controller board.

Doc ID 15867 Rev 1

23/46

Connectors and functionality of the TS4657 audio card

UM0722

Figure 21. TS2012 stereo Class-D amplifier functionality

5 V

C5 C6 C7 1 µF 1 µF 100 nF

GND GND GND

Stereo Class-D amplifier

GND GND Gain control

R1 10 K
C11

Input from

220 nF C12

TS4657 220 nF

R2 10 K
16 LIN + 17 LIN ­ G0 15 G0 G1 1 G1

Gain select

5 V 9 AVCC

5V5V

GND

3 13

U2 ST: TS2012IQT L1

100 pF C8

PVCC PVCC LOUT+

PWM

H bridge

P2

BLM18EG221SN1 1

2

L2

2

5

Terminal block

C9

LOUT­ BLM18EG221SN1 100 pF

Oscillator

GND

GND C13 20 RIN + Gain 220 nF19 RIN ­ select

C15 220 nF STBY_L 7
STBY_R 8 GND

STBY L Standby STBY R control

ROUT+

100 pF

PWM

H

14

L3

bridge

BLM18EG221SN1

ROUT­ 11

L4

C30 P3
2 1

Terminal block

BLM18EG221SN1 C31

PGND

100 pF

AGND

PGND E-PAD

R9 10 K

R10 10 K
Channel standby

GND GND

18 GND

4 12 21 GND

GND
External speakers

AM00490

Warning:

The maximum output power per channel of the TS2012 stereo amplifier is 1.35 W at 5 V into 8  speaker and 2.2 W at 5 V per channel into 4  speaker. Please take into consideration the maximum current of the USB port which is typically 500 mA (2.5 W). When the demonstration kit sinks more current from the USB port, it is automatically disconnected from the PC. If this happens just unplug and plug again your demonstration kit.

24/46

Doc ID 15867 Rev 1

UM0722
10 LEDs and buttons

LEDs and buttons

10.1

LED indicators on the STM32 controller board
The green LED (LD2) indicates that the demonstration kit is in operating mode. When it is switched on continuously, the PC USB demonstration kit is active; when it flashes, the card operates in the record-replay. The red LED (LD1) indicates the selected audio output. LD1 switched on continuously indicates that the TS2012 power output is used. By default, LD1 is switched off and the onboard speaker is selected.

10.2

LED indicators on the TS4657 audio card
The TS4657 audio card board features one green LED (LED1). It indicates that the +5 V supply voltage is present on pin 2 of the I2S audio connector P1.

10.3

B1 button on the STM32 controller board
B1 button is used to switch between audio outputs and also between demonstration kit operating modes. To switch from onboard speaker to TS2012 power output, briefly press B1. To change the operating mode from PC USB demonstration kit to record-replay, press B1 for approximately 1s.

Doc ID 15867 Rev 1

25/46

Demonstration kit software
11 Demonstration kit software

UM0722

This section presents the main ready-to-use software techniques that are implemented on the STM32 performance line USB demonstration kit.

11.1

Design firmware upgrade
This paragraph describes the implementation of a device firmware upgrade (DFU) capability in the STM32F103xx microcontroller. It follows the DFU class specification defined by the USB Implementers Forum for reprogramming an application through USB. The DFU principle is particularly well suited for the USB applications that need to be reprogrammed in the field: The same USB connector can be used for both the standard operating mode and the reprogramming process.
This operation is made possible by the IAP capability featured by most of the STMicroelectronics USB Flash microcontrollers, which allows a Flash MCU to be reprogrammed by any communication channel.
The DFU process, like any other IAP process, is based on the execution of firmware located in one small part of the Flash memory. This firmware manages the erase and program of the others Flash memory areas, depending on the device features:
Main program/Code Flash, data Flash/EEPROM, or any other memory connected to the microcontroller including serial I2C or SPI Flash memories).
The STM32 performance line USB demonstration kit features DFU capability used to program the internal Flash memory.
Refer to the UM0412, Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension (available online from: www.st.com/mcu), for more details on the driver installation and PC user interface.

11.2

USB Audio Device Class
An audio device, as defined by the Universal Serial Bus Class Definition for audio devices specification, is a device or a function embedded in composite devices that are used to manipulate audio, voice, and sound-related functionality. This includes both audio data (analog and digital) and the functionality that is used to directly control the audio environment, such as volume and tone control.
All audio devices are grouped, from the USB-FS-device point of view, in the audio interface class. This class is divided into several subclasses. The Universal Serial Bus Class Definition for audio devices specification details the three following subclasses:
 AudioControl Interface subclass (AC): each audio function has a single AudioControl interface. The AC interface is used to control the functional behavior of a particular audio function. To achieve this functionality, this interface can use the following endpoints:
­ A control endpoint (endpoint 0) for manipulating unit and terminal settings and retrieving the state of the audio function using class-specific requests.
­ An interrupt endpoint for status returns. This endpoint is optional. The AudioControl interface is the single entry point to access the internals of the audio

26/46

Doc ID 15867 Rev 1

UM0722

Demonstration kit software

function. All requests that are concerned with the manipulation of certain audio controls within the audio function's units or terminals must be directed to the AudioControl interface of the audio function. Likewise, all descriptors related to the internals of the audio function are part of the class-specific AudioControl interface descriptor.
 AudioStreaming Interface Subclass (AS): AudioStreaming interfaces are used to interchange digital audio data streams between the host and the audio function. They are optional. An audio function can have zero or more AudioStreaming interfaces associated with it, each possibly carrying data of a different nature and format. Each AudioStreaming interface can have at most one isochronous data endpoint.
 MIDIStreaming Interface Subclass (MIDIS): MIDIStreaming interfaces are used to transport MIDI data streams into and out of the audio function. To be able to manipulate the physical properties of an audio function, its functionality must be divided into addressable entities. Two types of such generic entities are identified and are called units and terminals. The Universal Serial Bus Class Definition for audio devices specification defines seven types of standard units and terminals that are considered adequate to represent most audio functions. These are:
­ Input terminal
­ Output terminal
­ Mixer unit
­ Selector unit
­ Feature unit
­ Processing unit
­ Extension unit
For more information about the audio class characteristics and requirements please refer to the Universal Serial Bus Device Class Definition for audio devices specification provided by the usb.org website.

11.3
11.3.1

PC USB demonstration kit and record-replay applications
In order to demonstrate all capabilities of the TS4657 audio card is the delivered user application structured into two operation modes: PC USB demonstration kit and recordreplay.
PC USB demonstration kit application
This part of the demonstration firmware gives examples of how to use the STM32F10xxx USB-FS-device peripheral to communicate with the PC host in the isochronous transfer mode. The code provides a demonstration of the correct method for configuring an isochronous endpoint, receiving or transmitting data from/to the host and also shows how to use the data in a real-time application.

Doc ID 15867 Rev 1

27/46

Demonstration kit software

UM0722

11.3.2

General characteristics  USB-FS-device characteristics:
­ Endpoint 0: used to enumerate the device and to respond to class-specific requests. The maximum packet size of this endpoint is 64 bytes.
­ Endpoint 1 (OUT): used to receive the audio stream from the PC host with a maximum packet size up to 192 bytes.
 Audio characteristics: ­ Audio data format: type I / PCM format / stereo.
­ Audio data resolution: 16 bits. ­ Sample frequency: 48 kHz.  I2S characteristics: ­ Channel frequency (also called LEFT/RIGHT clock) is 48 kHz
­ MCLK, the external master clock is 12.288 MHz ­ Packet frame is fixed to 16-bit
­ Data format is LSB-justified standard (Right-Justified)
The aim of the PC demonstration kit application mode is to store the data (audio Stream) received from the host PC in a specific buffer called Stream_Buffer and to use the I2S peripheral to play it through external DAC afterwards.
As detailed before, the STM32F10xxx manages the isochronous data transfer using the double buffer mode. So to copy the received data from the PMA to the Stream_Buff (using DMA transfer), the swapping between the two PMA buffers (ENDP1_BUF0Addr and ENDP1_BUF1Addr) has to be managed. Swapping access to the PMA is managed according to the buffer usage between the USB-FS-device IP and the firmware. This operation is provided by the EP1_OUT_Callback () function (usb_endp.c file). After the end of the copy process, global variables called B0_Ready or B1_Ready are set.
To play back the audio samples received from the host is the I2S audio peripheral used. The Samples variable controls the streaming flow to synchronize the data from the USB-FSdevice with the Stream buffer used by the I2S peripheral.
For further details on usage of USB-FS-device firmware library for Audio Device Class purposes, please refer to UM0424, STM32F10xxx USB-FS-device development kit available online from www.st.com.
Record-replay application
In the second mode of operation has the demonstration application task to capture vicinity sound from embedded microphone, process simple normalization of the signal, store acquired waveform into buffer in RAM (Record_Buff[]) in PCM16 format and finally play this sample back through the same I2S mechanism like in previous application mode. This procedure is performed in a infinite loop till another mode is set by button press.

28/46

Doc ID 15867 Rev 1

UM0722

Demonstration kit software

11.4

Updating demonstration application in the demonstration kit
For the STM32 the DFU mode is entered after an MCU reset if:
 The DFU mode is forced by the user: the user presses the key push-button during a reset (while he is attaching the evaluation dongle to the USB).
 There is no correct code available in the applicative area: before jumping to the applicative code, the DFU code tests if there is a correct top-of-stack address in the first address in the applicative area of the internal Flash memory (for the STM32F10xxx the first applicative address is 0x0800 3000). This is done by reading the value of the first applicative address and verifying if the MSB half-word is equal to 0x2000 (base address of the RAM area in the STM32F10xxx).
Once the device is in the DFU mode, you can simply update main application with support of tools coming from STM in DfuSe package. For further information, please refer to UM0412 "Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension" user manual, available online from: www.st.com/mcu.

Doc ID 15867 Rev 1

29/46

Test measurement of the audio signal
12 Test measurement of the audio signal
Figure 22. Typical I2S waveform
CK

UM0722

WS

Transmission

Reception

SD

16-bit

MSB

LSB MSB

Channel left

Channel right

ai17174

Figure 23. TS4657 output versus the I2S input (10 kHz signal reconstruction)

30/46

Doc ID 15867 Rev 1

UM0722

Test measurement of the audio signal

Figure 24. TS4657 output versus the I2S input (10 kHz signal reconstruction) - detail

Figure 25. Typical output from the Class-D amplifiers

Doc ID 15867 Rev 1

31/46

Addendum
13 Addendum

UM0722

Appendix A STM32F103 controller board - BOM

Table 7. Bill of material

Description Comment Designator Footprint Qty Supplier name

Button Polarized capacitor Polarized capacitor Capacitor Capacitor Capacitor
Capacitor

DT2112C B1 4.7 µF C1

Button_DT2112C 1 GM Electronic®

3528_AB

1 GM Electronic

4.7 µF 1 µF 10 nF 4.7 nF
100 nF

C5

3528_AB

C2, C3
C4
C6
C7, C9, C11, C12, C13, C14, C15

C1206 0603 0603
0603

1 GM Electronic 2 GM Electronic 1 GM Electronic 1 GM Electronic
7 GM Electronic

Capacitor

100 nF C16

0603

1 GM Electronic

Capacitor

33 pF C8, C10 0603

2 GM Electronic

JTAG header, side
mounting

MLW20G CN1

HDR2X10 S

1 GM Electronic

USB Connector

USB1X90A PCB

CN2

USB_1X90A_PC B4_MV

1 GM Electronic

BLM18EG22 1SN1

Inductor

L1

0603

Farnell (Murata 1 Manufacturing
Co.,Ltd.)

LED 0805 RED 45/130°

GME 960-024

LD1

D0805B

1 GM Electronic

LED 0805 GREEN 35/130°

GME 960-023 LD2

D0805B

1 GM Electronic

Header, 10-pin, dual
row, side mounting

BL220G P2

HDR2X10 S

1 GM Electronic

Resistor

10 K

R1, R2, R6, R9, R10, 0603 R14

6 GM Electronic

Supplier order code

Note

630-121 907-125

Do not populate

907-125

905-152 972-014 972-067

972-012

972-012 972-019 800-036

Do not populate

832-139

1515716

960-024

960-023

832-070

901-399

32/46

Doc ID 15867 Rev 1

UM0722

STM32F103 controller board - BOM

Table 7. Bill of material (continued)

Description Comment Designator

Footprint Qty Supplier name

Supplier order code

Note

Resistor

1.5 k R3

0603

1 GM Electronic

901-504

Resistor Resistor Resistor Resistor

4.7  1 M 0  470 

R4, R5 R7 R8 R12

0603 0603 0603 0603

2 GM Electronic 1 GM Electronic 1 GM Electronic 1 GM Electronic

901-648 901-445 901-396 901-495

Resistor

220  R13

0603

1 GM Electronic

901-491

STM32

ARM-based

32-bit MCU with 512 KB

STM32F103RE T6

U1

Flash, 64-pin

LQFP

LQFP64_N

1 STMicroelectronics STM32F103RET6

Stabilizator LD3985XX33 U2

SOT23-5L

1 STMicroelectronics LD3985M33

64 Mbit, low voltage,
Serial Flash memory

M25P64VME6G

U3

VDFPN8(8*6)

1 STMicroelectronics

M25P64-VME6G

Do not populate

Very low capacitance
ESD protection

USBLC6-2P6 U4

SOT-666

1 STMicroelectronics USBLC6-2P6

Crystal

TSX-3225 / 16MHz

X1

TSX-3225_FA238

1 EPSON

TSX-3225 / X1E00002101140 1

Capacitor

1 µF

C1, C2, C3,

C4, C5, C6, C24, C27,

[0603]

C29

9 Farnell (Kemet)

9227776

Capacitor

100 nF

C7, C16, C17, C19, C20, C21, C22, C25, C34

[0603]

9 GM Electronic

972-012

Capacitor

100 pF

C8, C9, C18, C23, C30, C31, C32, C33

[0603]

8 GM Electronic

972-013

Capacitor

2.2 nF C10, C14 [0603]

2 GM Electronic

972-060

Capacitor

220 nF

C11, C12, C13, C15

[0603]

4 GM Electronic

972-034

Polarized capacitor (surface mount)

10 µF/16V

C26, C35, C36

C3225[1210]

3 GM Electronic

907-112

Doc ID 15867 Rev 1

33/46

STM32F103 controller board - BOM

UM0722

Table 7. Bill of material (continued)

Description Comment Designator

Footprint Qty Supplier name

Supplier order code

Capacitor 0  /22 nF C28

[0603]

1 GM Electronic

901-396

Typical red,

green, yellow, amber GaAs

LED_GREEN_ 0805

LED1

LED

2012[0805]_TO_ DIODE_wave

1 GM Electronic

960-023

RCA phono jack, right
angle, RCA WBTOR 1 J1, J3 thru-hole, snap-in

RCA/4.5-H2

2 Farnell (Lumberg) 1200146

Socket, 3.5 mm jack,
mono

Lumberg 06

1503

J4

JACK/6-V3A

1 Farnell (Lumberg) 1243243

Inductor

BLM18EG221S L1, L2, L3,

N1

L4, L5, L6

1608[0603]

6 Farnell (Murata)

1515716

Header, 10-pin, dual
row, side mounting

Header 2 x 10 pin, P1
S2G20

HDR2X10 S

1 GM Electronic

832-023

Header, 2-pin,
terminal block, PCB, 2.54 mm,
2-way

Terminal block P2, P3

MPT 0,5/ 2-2,54

Farnell 2 (PHOENIX
CONTACT)

3041359

Resistor

10 K

R1, R2, R7,

R8, R9, R10, R13,

[0603]

R15, R20

9 GM Electronic

901-399

Resistor Resistor Resistor

100 K 820  680 

R3 R4, R5 R6

[0603] [0603] [0603]

1 GM Electronic 2 GM Electronic 1 GM Electronic

901-529 901-500 901-498

Resistor Resistor Resistor

1 K 150 k
68 

R11, R12 R14, R16 R17

[0603] [0603] [0603]

2 GM Electronic 2 GM Electronic 1 GM Electronic

901-502 901-633 901-408

Single supply

stereo digital audio line

ST:

TS4657IQT U1

driver

QFN20_TS4657 1 STMicroelectronics TS4657IQT

Note

34/46

Doc ID 15867 Rev 1

UM0722

STM32F103 controller board - BOM

Table 7. Bill of material (continued)

Description Comment Designator

Footprint Qty Supplier name

Supplier order code

Filter-free

stereo

2 x 2.8 W Class-D

ST: TS2012IQT U2

audio power

amplifier

2.8 W filterfree mono Class-D ST: TS4962IQT U3 audio power amplifier

Low noise microphone ST: TS472IQT U4 preamplifier

Microphone KEEG1542PBL U5

QFN20 - TS2012 1 STMicroelectronics TS2012IQT

DFN8 - TS4962 1 STMicroelectronics TS4962IQT

QFN24_TS472 1 STMicroelectronics TS472IQT

KEC2740

1 Farnell (KINGSTATE) 1502746

Transducer, speaker

KSSG1708 U6

KSS1708

1 Farnell (KINGSTATE) 1502738

Note

Doc ID 15867 Rev 1

35/46

STM32F103 controller board
Appendix B STM32F103 controller board
Figure 26. STM32F103 controller board - top overlay

UM0722

Figure 27. STM32F103 controller board - bottom overlay

36/46

Doc ID 15867 Rev 1

UM0722 Figure 28. TS4657 audio card - top layer

STM32F103 controller board

Figure 29. TS4657 audio card - bottom layer

Doc ID 15867 Rev 1

37/46

TS4657 audio card - artwork prints
Appendix C TS4657 audio card - artwork prints
Figure 30. TS4657 audio card - top overlay

UM0722

Figure 31. TS4657 audio card - bottom overlay

38/46

Doc ID 15867 Rev 1

UM0722 Figure 32. TS4657 audio card - top layer

TS4657 audio card - artwork prints

Figure 33. TS4657 audio card - bottom layer

Doc ID 15867 Rev 1

39/46

Doc ID 15867 Rev 1

40/46

U1

PA0

14

PA1

15

PA2

16

PA3

17

SPI1_NSS 20

SPI1_SCK 21

SPI1_MISO 22

SPI1_MOSI 23

PA0-WKUP PA1 PA2 PA3 PA4 PA5 PA6 PA7

PB0 PB1 PB2/BOOT1 PB3/JTDO PB4/JNTRST PB5 PB6 PB7

26 27 28 55 56 57 58 59

CN1 MLW20G 3.3 V
1 2 3 4 5 6 7

JTRST Internal pull-up JTDI Internal pull-up JTMS Internal pull-up

BUTTON 41 42 43
USBDN 44 USBDP 45 JTMS 46 JTCK 49 JTDI 50

PA8 PA9 PA10 PA11 PA12 PA13/JTMS/SWDIO PA14/JTCK/SWCLK PA15/JTDI

PB8 PB9 P B10 P B11 PB12 PB13 PB14 PB15

61 62 29 30 33 34 35 36

8 9 10 11 12 13 14 15 16 17 18 19 20

JTCK Internal pull-down

RTCK

R1

10 K JTDO

NRST

DBGRQ R2 10 K

DBGACK R14 10 K

X1

5

X2

6

54

R6 BOOT0 60 10 k
NRST 7

C9 100 nF

1

OSC_IN/PD0 OSC_OUT/PD1 PD2
BOOT 0
NRST

PC 0 PC 1 PC 2 PC 3 PC 4 PC 5 PC 6 PC 7

8 9 10 11 24 25 37 38

VBAT

PC 8 PC 9 PC10 PC11 PC12 PC13-TAMPER-RTC PC14-OSC32_IN PC15-OSC32_OUT

39 40 51 52 53 2 3 4

3.3 V

3.3 V L1
Inductor

A 3.3 V

32 48 64 19

VVVDDDDDD___123 VDD_4

13 VDDA

10 nH VSSA

C15 STM32F103RET6 100 nF

VVSSSS__12 VSS_3 VSS_4

31 47 63 18

VSSA 12

BOOT 1 JTDO JTRST I2C1_SCL I2C1_SDA
I2S2_WS I2S2_CK I2S2_SD PC0 PC1 PC2 PC3
I2S2_MCK
USB_ACTIVITY LED_ACTIVE
R8 0 
VSSA
AM00491

Figure 34. STM32F103 controller board - schematic - part 1

Appendix D STM32F103 controller board - schematic

UM0722

STM32F103 controller board - schematic

UM0722

Figure 35. STM32F103 controller board - schematic - part 2

PA3 PA1

A 3.3 V

VSSA PC3 PC2 PC1 PC0

P2
12 34 56 78 9 10 11 12 13 14 15 16 17 18 19 20

BL220G

3.3 V

USB 5 V
PA2 PA0 I2S2_WS I2S2_C K I2S2_SD I2S2_MCK I2C1_SDA I2C1_SCL
3.3 V

CN 2

USB1X90APC B

USB_A VBUS D­ D+ GND SH1 SH2

1
2 3 4 5 6

USB 5 V R7

1 M

C6 4.7 nF

C11 C12 C13 C14 100 nF 100 nF 100 nF 100 nF

U4

1 2 3

I/O1 I/O1 GND VBUS

6 5 4

I/O2 I/O2

USBLC6-2P6

R4 4.7  USBDN USB 5 V
R5 4.7  USBDP
R3 1.5 k 3. 3 V

X1 GND 4

3 X2

X1 1

2

GND TSX-3225 / 16 MHz C8 33 pF

C10 33 pF

Doc ID 15867 Rev 1

STM32F103 controller board - schematic

3.3 V
R10 10 k
BUTTON 2
B1 1

USB 5 V
C2 C5 1µF 4.7µF

U2

1 VIN 2 GND

VOUT 5

3 INHB BYPASS 4

LD3985XX33

C4 10 nF

3. 3 V

C3

C1

1µF

4.7µF

C7 100 nF
3.3 V

USB_ACTIVITY

LD2

2

1

3.3 V R12 R13

LD1 2.3 V

1

2 LED_ACTIVE

470  220 

3.3 V C16

GME960-024

SPI1_NSS SPI1_MISO

R9 10 K

100 nF U3

7 8 1 2

HOLD C

VCC S

D VSS

Q

W

6 5 4 3

SPI1_SCK SPI1_MOSI

M25P64-VME6G 3.3 V

AM00493

41/46

TS4657 audio card - schematic
Appendix E TS4657 audio card - schematic
Figure 36. TS4657 audio card - schematic - part 1

42/46

Doc ID 15867 Rev 1

VCCA

C18

5 V C16 C26

C27

C17 VCCA 100 nF

100 pF C23

Microphone

10 µF / 16 V 100 nF

1 µF

GNDA 20

15 14 100 pF U4

GNDA

GND 5 V

GNDA
U5 2 1

R11 1 K
C19 8 IN +
100 nF C20 5 IN­

VCC

C1 C2 OUT+ 17
OUT­ 16

R3 C28 100 K

C34 C35 10 µF / 16 V

MICRO_OUT 100 nF

0  / 22 nF

GND

C28: assembly 0  resistor

5 V

K EEG1542P BL

100 nF

R12 1 K

10 Bias

G GAIN 9

BYPS

Bias

2

for DC coupling R17 68 

C36 10 µF / 16 V

GNDA 5 V 680  R6 LED1

2.0 V GND 22 4
ST: TS472IQT GNDA

LED_GREEN_0805

GND

GND STBY

C29 GNDA

Controller board connector

1 µF

GND P1

5 V

21

GNDA MICRO_SHDN

MICRO_SHDN

R15 10 K

MICRO_OUT VCCA

GNDA STBY_R

STBY_L

1 3 5 7 9 11 13

2 4 6 8 10 12 14

GNDA

DAC_STBY

15 16

SPK_STBY

17 18 19 20

G0 G1 DAC_LRCLK DAC_BCL K DAC_SDAT DAC_MCLK DAC_FMT2 DAC_FMT1

GND

Microphone preamplifier

GND

UM0722

AM00494

43/46

Doc ID 15867 Rev 1

DACLOUT DACROUT

Stereo Class-D amplifier

RCA WBTOR 1 J1

GND

GND

Gain control

GND

R1 R2 C11 10 K 10 K
16

220 nF

17

C12

G0 15

220 nF

G1

1

LIN+ LIN­ G0 G1

Gain select

5 V 9 AV CC

5V 5V

GND

3 13

U2

ST: TS2012IQ T

L1

100 pF C8

PV CC PV CC

LOUT+

PWM

H bridge

LOUT­

Oscillator

P2

BLM18EG221SN1

1

2

L2

2

5 BLM18EG221SN1

Terminal
block C9 100 pF

GND

GND

GND

C15
220 nF J3 RCA WBTOR 1
GND R9
10 K

C13 20
220 nF 19

RIN+ RIN­

Gain select

STBY_L 7 STBY_R 8
R10 10 K

STBYL Standby STBYR control

AGND 18

GND GND Channel standby GND

PWM

ROUT+ H bridge
ROUT­

PGND PGND E-PA D 4 12 21 GND

100 pF

14

L3

C30

11BLM18EG221SN1

P3 2

L4

1

Terminal BLM18EG221SN1 block

C31 100 pF GND

External speakers

GND

GND

R13

SP K_STBY

10 K 1

C21

R14

100 nF 150 K 3

C22

R16

4

100 nF 150 K

5 V

Mono Class-D amplifier

5 V GND 6 79

300 K

STBY

Internal bias

150 K IN+
IN­

150 K

VCCA GNDA E-PAD

PWM

OUT+

Output H
bridge

OUT­

Oscillator

Mono jack
U3 Lumberg 1503 06

GND

J4

L5 5
BLM18EG221SN1

100 pF C32

L6 8 BLM18EG221SN1

C33 2 1 100 pF

C24 C25 NC
1 µF 100 nF 2
GND GND ST:TS4962IQ T

GND

U6

Speaker KSSG1708

AM00492

UM0722 Figure 37. TS4657 audio card - schematic - part 2

TS4657 audio card - schematic

TS4657 audio card - schematic Figure 38. TS4657 audio card - schematic - part 3

44/46

5 V C1

5 V C2

DA C

C3

C4

GND 1 µF 13

1 µF

1 µF

19

GND

18 14

1 µF GND U1

VCCA NCP

VCCD

VREGD LDO

VREGA

PC P

LDO

GND
C10 2.2 nF

DAC_LRCL K 3 DAC_SDAT 4 DAC_BCL K 5 DAC_MCL K 6
DAC_FMT2 7 DAC_FMT1 8

LRCLK

SDAT BCLK M CLK

Digital audio interface

Digital filters

FMT2 FMT 1

Control interface

STDBY

DAC DAC

+

LOUT

­

+

ROUT

­

GNDA

GNDD

GNDD GNDA GNDA E-PA D

12 R4 820 
11 R5 820  C14 2.2 nF GND

R7 10 K

R8

9

10 K

DAC_STB Y

20 2 R20

GND GND

10 K

GND

1 10 15 16 17 21 GND

DACLOUT DACROUT

Doc ID 15867 Rev 1

C5 1 µF

C6 1 µF

5 V C7 100 nF

GND GND GND

AM00495

UM0722

UM0722
Revision history

Table 8. Docsument revision history

Date

Revision

27-Aug-2009

1

Initial release.

Revision history Changes

Doc ID 15867 Rev 1

45/46

UM0722

Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST's terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST'S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER'S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2009 STMicroelectronics - All rights reserved
STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan -
Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com

46/46

Doc ID 15867 Rev 1


Acrobat Distiller 7.0.5 (Windows) (via http://big.faceless.org/products/pdf?version=2.6.5)