UM0722 User manual - BDTIC · 2013. 10. 18. · – I²S, right- or left-justified compatible...
Transcript of UM0722 User manual - BDTIC · 2013. 10. 18. · – I²S, right- or left-justified compatible...
August 2009 Doc ID 15867 Rev 1 1/46
UM0722User manual
Getting started with STEVAL-CCA021V1,STM32 performance line USB demonstration kit
1 Introduction
This user manual describes hardware and software of the STMicroelectronics™ STM32™ 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
www.st.com
www.BDTIC.com/ST
Contents UM0722
2/46 Doc ID 15867 Rev 1
Contents
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
www.BDTIC.com/ST
UM0722 Contents
Doc ID 15867 Rev 1 3/46
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
www.BDTIC.com/ST
List of tables UM0722
4/46 Doc ID15867 Rev 1
List of tables
Table 1. I2S audio connector pins description of the STM32 controller board . . . . . . . . . . . . . . . . . 15Table 2. JTAG connector pins description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Table 3. I2S audio connector pins description of the TS4657 audio card . . . . . . . . . . . . . . . . . . . . . 17Table 4. Mono jack connector J4 pins description of the TS4657 audio card . . . . . . . . . . . . . . . . . 18Table 5. TS2012 stereo output terminal connectors P2, P3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Table 6. TS4657 stereo DAC output audio RCA connectors J1, J3 . . . . . . . . . . . . . . . . . . . . . . . . . 19Table 7. Bill of material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Table 8. Docsument revision history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
www.BDTIC.com/ST
UM0722 List of figures
Doc ID 15867 Rev 1 5/46
List of figures
Figure 1. STM32F103 USB demonstration kit - top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Figure 2. STM32F103 USB demonstration kit - block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Figure 3. Device manager window - new USB audio device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 4. STM32 controller board layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Figure 5. TS4657 audio card board layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Figure 6. Onboard speaker system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Figure 7. External mono speaker or headphone system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Figure 8. External amplified stereo output system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Figure 9. Lineout output system setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Figure 10. Microphone record-replay mode system setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Figure 11. I2S audio connector of the STM32 controller board - schematic . . . . . . . . . . . . . . . . . . . . 15Figure 12. JTAG connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Figure 13. JTAG connector CN1 - schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Figure 14. I2S audio connector of the TS4657 audio card - schematic . . . . . . . . . . . . . . . . . . . . . . . . 17Figure 15. Mono jack audio connector J4 and the onboard speaker U6 . . . . . . . . . . . . . . . . . . . . . . . 18Figure 16. TS2012 stereo output terminal connectors P2, P3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Figure 17. TS4657 stereo DAC output audio RCA connectors J1, J3 . . . . . . . . . . . . . . . . . . . . . . . . . 20Figure 18. Microphone functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Figure 19. TS4657 stereo audio DAC functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Figure 20. TS4962 mono Class-D amplifier functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Figure 21. TS2012 stereo Class-D amplifier functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Figure 22. Typical I2S waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Figure 23. TS4657 output versus the I2S input (10 kHz signal reconstruction) . . . . . . . . . . . . . . . . . . 30Figure 24. TS4657 output versus the I2S input (10 kHz signal reconstruction) - detail . . . . . . . . . . . . 31Figure 25. Typical output from the Class-D amplifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Figure 26. STM32F103 controller board - top overlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Figure 27. STM32F103 controller board - bottom overlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Figure 28. TS4657 audio card - top layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Figure 29. TS4657 audio card - bottom layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Figure 30. TS4657 audio card - top overlay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Figure 31. TS4657 audio card - bottom overlay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Figure 32. TS4657 audio card - top layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Figure 33. TS4657 audio card - bottom layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Figure 34. STM32F103 controller board - schematic - part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Figure 35. STM32F103 controller board - schematic - part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Figure 36. TS4657 audio card - schematic - part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Figure 37. TS4657 audio card - schematic - part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Figure 38. TS4657 audio card - schematic - part 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
www.BDTIC.com/ST
Description UM0722
6/46 Doc ID 15867 Rev 1
2 Description
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® Cortex™-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 power-saving 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 high-performance, 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.
www.BDTIC.com/ST
UM0722 Boards key features
Doc ID 15867 Rev 1 7/46
3 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
www.BDTIC.com/ST
General system description UM0722
8/46 Doc ID 15867 Rev 1
4 General system description
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
STM32
TS4657 TS2012
I2S
Digital control
TS472
USB TS4962
AnalogMono jack
for external speaker
On board microphone
Connectors for
external speakers
Stereo lineout
RCA
Onboard speaker
RCA
AM00480
www.BDTIC.com/ST
UM0722 Getting started
Doc ID 15867 Rev 1 9/46
5 Getting started
5.1 System requirementsIn 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 contentsThe 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 installationThe 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.
www.BDTIC.com/ST
Getting started UM0722
10/46 Doc ID 15867 Rev 1
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
www.BDTIC.com/ST
UM0722 Boards layout
Doc ID 15867 Rev 1 11/46
6 Boards layout
6.1 STM32 controller board layout
Figure 4. STM32 controller board layout
6.2 TS4657 audio card layout
Figure 5. TS4657 audio card board layout
www.BDTIC.com/ST
System setup UM0722
12/46 Doc ID 15867 Rev 1
7 System setup
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. Short-circuiting the power audio amplifier output pins may damage the power audio amplifier output stages.
7.1 Demonstration kit output mode
7.1.1 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.
www.BDTIC.com/ST
UM0722 System setup
Doc ID 15867 Rev 1 13/46
Figure 7. External mono speaker or headphone 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 modeThe 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.
www.BDTIC.com/ST
System setup UM0722
14/46 Doc ID 15867 Rev 1
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
www.BDTIC.com/ST
UM0722 Connectors of the STM32 performance line controller board
Doc ID 15867 Rev 1 15/46
8 Connectors of the STM32 performance line controller board
8.1 I2S audio connector P2The 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.
Figure 11. I2S audio connector of the STM32 controller board - schematic
8.2 JTAG connector CN1The 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 Systems™ or RLink from Raisonance, etc. There exists a wide
Table 1. I2S audio connector pins description of the STM32 controller board
Pin Signal Pin Signal Pin Signal Pin Signal
1 GND 6 PA0 pin of the MCU 11PC3 pin of the MCU
16PB7 pin of the MCU (I2C1_SDA funct. not used)
2 +5V0 from USB 7A3V3 - +3V3 supply voltage for analog domain
12I2S2_SD, PB15 pin of the MCU
17Standby for TS4962 (onboard speaker and mono jack)
3PA3 pin of the MCU
8I2S2_WS, PB12 pin of the MCU
13PC2 pin of the MCU
18 PB6 pin of the MCU (I2C1_SCL funct. not used)
4PA2 pin of the MCU
9VSSA ground for analog domain
14I2S2_MCK, PC6 pin of the MCU
19 GND
5PA1 pin of the MCU (ADC)
10I2S2_CK, PB13 pin of the MCU
15PC1 pin of the MCU
20 +3V3
1 23 45 67 89 1011 1213 1415 1617 1819 20
P2
Header 10 x 2 S
PC0PC1PC2PC3
PA0PA1PA2PA3
I2S2_MCK
USB 5 V
3.3 V
A 3.3 V
I2C1_SCLI2C1_SDA
I2S2_WSI2S2_CKI2S2_SD
VSSA
AM00481
www.BDTIC.com/ST
Connectors of the STM32 performance line controller board UM0722
16/46 Doc ID 15867 Rev 1
choice of development tools on the market supporting microcontroller Flash memory programming and application debugging.
Figure 12. JTAG connector
Figure 13. JTAG connector CN1 - schematic
Table 2. JTAG connector pins description
Pin Signal Pin Signal Pin Signal Pin Signal
1 3V3 DC 6 GND 11RTCK Connected to GND by R1 (10 kΩ)
16 GND
2 3V3 DC 7 JTMS 12 GND 17DBGRQ Connected to GND by R2 (10 kΩ)
3 JTRST 8 GND 13 JTDO 18 GND
4 GND 9 JTCK 14 GND 19DBGACK Connected to GND by R14 (10 kΩ)
5 JTDI 10 GND 15 NRST 20 GND
1
2
3 5 7 9
4 6 8 10
11 13 15 17 19
12 14 16 18 20
AM00262
Internal pull-up
Internal pull-up
Internal pull-up
Internal pull-down
1234567891011121314151617181920
CN1JTAG 3.3 V
R2 10 KΩ
R14 10 KΩ
R1
10 KΩ
RTCK
DBGRQ
DBGACK
JTRST
JTDI
JTMS
JTCK
JTDO
NRST
AM00482
www.BDTIC.com/ST
UM0722 Connectors and functionality of the TS4657 audio card
Doc ID 15867 Rev 1 17/46
9 Connectors and functionality of the TS4657 audio card
9.1 I2S audio connector P1The 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.
Figure 14. I2S audio connector of the TS4657 audio card - schematic
9.2 Mono jack connector J4 and the onboard speaker U6The 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
Table 3. I2S audio connector pins description of the TS4657 audio card
Pin Signal Pin Signal Pin Signal Pin Signal
1 GND 6G1 Gain select for TS2012
11Right channel mute for TS2012
16Data format selection FMT2 for TS4657
2 +5V0 7
VCCA +3.3 V supply voltage for microphone domain
12TS4657 SDAT I2S signal
17Standby for TS4962 (onboard speaker and mono jack)
3Microphone shutdown
8TS4657 LRCLK I2S signal
13Left channel mute for TS2012
18Data format selection FMT1 for TS4657
4G0 gain select for TS2012
9GNDA ground for microphone domain
14TS4657 MCLK I2S signal (master clock)
19 GND
5Analog output from microphone preamplifier
10TS4657 BCLK I2S signal
15Standby for TS4657
20 NC
5 V
DAC_SDATDAC_BCLK
DAC_MCLKDAC_FMT2DAC_FMT1
DAC_LRCLK
STBY_RSTBY_L
G0G1
SPK_STBY
MICRO_OUTMICRO_SHDN
DAC_STBY
GND
1 23 45 67 89 1011 1213 1415 1617 1819 20
P1
VCCA
GND
GNDA
AM00483
www.BDTIC.com/ST
Connectors and functionality of the TS4657 audio card UM0722
18/46 Doc ID 15867 Rev 1
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
Figure 15. Mono jack audio connector J4 and the onboard speaker U6
9.3 TS2012 stereo output terminal connectors P2, P3The TS2012 stereo Class-D amplifier output is available outside the board through the onboard terminal connectors P2 and P3.
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)
3OUT+ line of the TS4962 amplifier connected to the pin 2 of the onboard speaker U6 when the external speaker is not connected.
2 1
KSSG1708
U6
Speaker
OUTPUT
8
5
6
Oscillator
PWM
1
4
3
IN–
IN+
STBYGNDA
7
VCCA
HBRIDGE
Internalbias
OUT+
OUT–
300 KΩ
150 KΩ
150 KΩ
2
NC
9
E-PAD
ST: TS4962IQT
U3
Lumberg 1503 06
J4
Mono jack
100 pFC32
100 pFC33
GND
GND
L5
BLM18EG221SN1
L6
BLM18EG221SN1
AM00484
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+
www.BDTIC.com/ST
UM0722 Connectors and functionality of the TS4657 audio card
Doc ID 15867 Rev 1 19/46
Figure 16. TS2012 stereo output terminal connectors P2, P3
9.4 TS4657 stereo DAC output audio RCA connectors J1, J3The TS4657 stereo DAC audio output is available as lineout signal through the onboard RCA connectors J1, J3.
Gain
select
Gain
select
Standby
control
19
20
15
1
17
16
7
8
11
14
5
2
9 3
418 12
PWMH
bridge
PWMH
bridge
Oscillator
13
RIN +
RIN –
LIN–
LIN +
G0
G1
STBY L
STBY R
AVCC
AGND PGND PGND
LOUT+
LOUT–
PVCC
ROUT+
ROUT–
21
E-PAD
ST: TS2012IQTU2
Externalspeakers
12
Terminal block
P2
12
Terminal block
P3
L1
BLM18EG221SN1
100pFC9
100 pFC8
100 pFC30
100 pFC31
GND
GND
GND
L2
BLM18EG221SN1
L3
BLM18EG221SN1
BLM18EG221SN1
L4
AM00485
PVCC
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
www.BDTIC.com/ST
Connectors and functionality of the TS4657 audio card UM0722
20/46 Doc ID 15867 Rev 1
Figure 17. TS4657 stereo DAC output audio RCA connectors J1, J3
9.5 Microphone functionalityAn 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.
RCA WBTOR 1J1
RCA WBTOR 1J3
1 15
DAC
DAC11
12
LDO
LDO
NCP
PCP
1413
Control interface
Digitalaudio
interface
Digitalfilters
18
20 2
7
8
6
5
4
3
19
9
MCLK
BCLK
FMT1
FMT2
SDAT
LRCLK
STDBY
17
GNDDGNDD
GNDA
10
GNDAGNDA
16
VCCA VCCD
VREGA
VREGD
21
E-PAD
ROUT
LOUT
U1
820 Ω
R4
820 Ω
R5
2.2 nFC10
2.2 nFC14
GND
GND
GND
GND
AM00486
www.BDTIC.com/ST
UM0722 Connectors and functionality of the TS4657 audio card
Doc ID 15867 Rev 1 21/46
Figure 18. Microphone functionality
9.6 TS4657 stereo audio DAC functionalityThe 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.
12
KEEG1542PBL
U5MICRO_OUT
Microphone
1 KΩR11
1 KΩR12
10 KΩR15
100 nFC17
100 nF
C19
100 nF
C20
100 pF
C18
100 pF
C23
MICRO_SHDN
VCCA
GNDA
GNDA
GNDA
16
17
20
Bias
G
21
5
8
IN–
IN+
GND
15
C1 OUT+
OUT–
4
14
C2
Bias2.0 V
VCC
STBY
10
9
2
22
GND
BYPS
GAIN
ST: TS472IQT
U4
VCCA
GNDA
C271 µF
GNDA
0 Ω / 22 nFC28: assembly 0R resistor for DC coupling
C28
C291 µF
GNDA
100 KΩR3
GNDA
Microphone preamplifier
68 ΩR17
GNDA
AM00487
www.BDTIC.com/ST
Connectors and functionality of the TS4657 audio card UM0722
22/46 Doc ID 15867 Rev 1
Figure 19. TS4657 stereo audio DAC functionality
9.7 TS4962 mono Class-D power amplifier functionalityThe 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.
RCA WBTOR 1J1
RCA WBTOR 1J3
1 15
DAC
DAC11
12
LDO
LDO
NCP
PCP
1413
Control interface
Digitalaudio
interface
Digitalfilters
18
20 2
7
8
6
5
4
3
19
9
MCLK
BCLK
FMT1
FMT2
SDAT
LRCLK
STDBY
17
GNDDGNDD
GNDA
10
GNDAGNDA
16
VCCA VCCDVREGA
VREGD
21
E-PAD
ROUT
LOUT
U1
820 Ω
R4
820 Ω
R5
2.2 nFC10
2.2 nFC14
1 µF
C1
1 µF
C2
1 µF
C3
1 µF
C4
DAC
GND
GND
GND
GND
GND
GNDGNDGND
5 V 5 V
DAC_STBY
DAC_SDAT
DAC_BCLK
DAC_MCLK
DAC_FMT2
DAC_FMT1
10 KΩR7
10 KΩR8
GND GND
DAC_LRCLK
10 KΩ
R20
GNDAM00488
www.BDTIC.com/ST
UM0722 Connectors and functionality of the TS4657 audio card
Doc ID 15867 Rev 1 23/46
Figure 20. TS4962 mono Class-D amplifier functionality
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 functionalityThe 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.
2 1
KSSG1708U6
Speaker
150 kΩ
R16
100 nF
C22150 kΩ
R14
100 nF
C21
5 V
SPK_STBY
C24
1 µF
5 V
100 nF
C25
OUTPUT
8
5
6
Oscillator
PWM
1
4
3
IN–
IN+
STBY GNDA
7
VCCA
HBRIDGE
Internalbias
OUT+
OUT–
300 KΩ
150 KΩ
150 KΩ
2
NC
9
E-PAD
ST: TS4962IQT
U3
10 KΩR13
GND
GND
GND
GND GND
Lumberg 1503 06
J4
Mono jack
100 pFC32
100 pFC33
GND
GND
L5
BLM18EG221SN1
L6
BLM18EG221SN1
Mono Class-D amplifier
Input from the TS4657left channel
AM00489
www.BDTIC.com/ST
Connectors and functionality of the TS4657 audio card UM0722
24/46 Doc ID 15867 Rev 1
Figure 21. TS2012 stereo Class-D amplifier functionality
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.
Gainselect
Gainselect
Standbycontrol
1920
15
1
17
16
7
8
11
14
5
2
9 3
418 12
PWM Hbridge
PWM Hbridge
Oscillator
13
RIN +RIN –
LIN –
LIN +
G0
G1
STBY L
STBY R
AV
AGNDPGND
PGND
LOUT+
LOUT–
CC PVCC
ROUT+
ROUT–
21
E-PAD
ST: TS2012IQTU2
5 V 5 V5 V
C6
1 µF
5 V
STBY_R
STBY_L
G0
G1
ExternalChannel standby
220 nF
C11
220 nF
C12
220 nF
C13
220 nF
C15
100 nF
C7
GND GND
GND GND GND
GND
GND
10 KΩR9
10 KΩR10
GND GNDspeakers
10 KΩR2
10 KΩR1
GNDGND Gain control
C5
1 µF
12
Terminal block
P2
12
Terminal block
P3
L1
BLM18EG221SN1
100 pFC9
100 pFC8
100 pFC30
100 pFC31
GND
GND
GND
L2
BLM18EG221SN1
L3
BLM18EG221SN1
BLM18EG221SN1
L4
Stereo Class-D amplifier
Input from TS4657
AM00490
PVCC
www.BDTIC.com/ST
UM0722 LEDs and buttons
Doc ID 15867 Rev 1 25/46
10 LEDs and buttons
10.1 LED indicators on the STM32 controller boardThe 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 cardThe 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 boardB1 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.
www.BDTIC.com/ST
Demonstration kit software UM0722
26/46 Doc ID 15867 Rev 1
11 Demonstration kit software
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 upgradeThis 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 ClassAn 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
www.BDTIC.com/ST
UM0722 Demonstration kit software
Doc ID 15867 Rev 1 27/46
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 PC USB demonstration kit and record-replay applicationsIn 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 record-replay.
11.3.1 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.
www.BDTIC.com/ST
Demonstration kit software UM0722
28/46 Doc ID 15867 Rev 1
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-FS-device 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.
11.3.2 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.
www.BDTIC.com/ST
UM0722 Demonstration kit software
Doc ID 15867 Rev 1 29/46
11.4 Updating demonstration application in the demonstration kitFor 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.
www.BDTIC.com/ST
Test measurement of the audio signal UM0722
30/46 Doc ID 15867 Rev 1
12 Test measurement of the audio signal
Figure 22. Typical I2S waveform
Figure 23. TS4657 output versus the I2S input (10 kHz signal reconstruction)
MSB LSB MSB
CK
WS
SD
Channel leftChannel right
16-bit
Transmission Reception
ai17174
www.BDTIC.com/ST
UM0722 Test measurement of the audio signal
Doc ID 15867 Rev 1 31/46
Figure 24. TS4657 output versus the I2S input (10 kHz signal reconstruction) - detail
Figure 25. Typical output from the Class-D amplifiers
www.BDTIC.com/ST
Addendum UM0722
32/46 Doc ID 15867 Rev 1
13 Addendum
Appendix A STM32F103 controller board - BOM
Table 7. Bill of material
Description Comment Designator Footprint Qty Supplier nameSupplier order
codeNote
Button DT2112C B1 Button_DT2112C 1 GM Electronic® 630-121
Polarized capacitor
4.7 µF C1 3528_AB 1 GM Electronic 907-125Do not populate
Polarized capacitor
4.7 µF C5 3528_AB 1 GM Electronic 907-125
Capacitor 1 µF C2, C3 C1206 2 GM Electronic 905-152
Capacitor 10 nF C4 0603 1 GM Electronic 972-014
Capacitor 4.7 nF C6 0603 1 GM Electronic 972-067
Capacitor 100 nF
C7, C9, C11, C12, C13, C14, C15
0603 7 GM Electronic 972-012
Capacitor 100 nF C16 0603 1 GM Electronic 972-012Do not populate
Capacitor 33 pF C8, C10 0603 2 GM Electronic 972-019
JTAG header, side
mountingMLW20G CN1 HDR2X10 S 1 GM Electronic 800-036
USB Connector
USB1X90A PCB
CN2USB_1X90A_PCB4_MV
1 GM Electronic 832-139
BLM18EG221SN1
Inductor L1 0603 1Farnell (Murata Manufacturing Co.,Ltd.)
1515716
LED 0805 RED 45/130°
GME 960-024 LD1 D0805B 1 GM Electronic 960-024
LED 0805 GREEN 35/130°
GME 960-023 LD2 D0805B 1 GM Electronic 960-023
Header, 10-pin, dual
row, side mounting
BL220G P2 HDR2X10 S 1 GM Electronic 832-070
Resistor 10 KΩR1, R2, R6, R9, R10, R14
0603 6 GM Electronic 901-399
www.BDTIC.com/ST
UM0722 STM32F103 controller board - BOM
Doc ID 15867 Rev 1 33/46
Resistor 1.5 kΩ R3 0603 1 GM Electronic 901-504
Resistor 4.7 Ω R4, R5 0603 2 GM Electronic 901-648
Resistor 1 MΩ R7 0603 1 GM Electronic 901-445
Resistor 0 Ω R8 0603 1 GM Electronic 901-396
Resistor 470 Ω R12 0603 1 GM Electronic 901-495
Resistor 220 Ω R13 0603 1 GM Electronic 901-491
STM32 ARM-based 32-bit MCU with 512 KB Flash, 64-pin
LQFP
STM32F103RET6
U1 LQFP64_N 1 STMicroelectronics STM32F103RET6
Stabilizator LD3985XX33 U2 SOT23-5L 1 STMicroelectronics LD3985M33
64 Mbit, low voltage,
Serial Flash memory
M25P64-VME6G
U3 VDFPN8(8*6) 1 STMicroelectronics M25P64-VME6GDo not populate
Very low capacitance
ESD protection
USBLC6-2P6 U4 SOT-666 1 STMicroelectronics USBLC6-2P6
CrystalTSX-3225 /
16MHzX1
TSX-3225_FA-238
1 EPSONTSX-3225 / X1E000021011401
Capacitor 1 µF
C1, C2, C3, C4, C5, C6, C24, C27, C29
[0603] 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 nFC11, C12, C13, C15
[0603] 4 GM Electronic 972-034
Polarized capacitor (surface mount)
10 µF/16VC26, C35, C36
C3225[1210] 3 GM Electronic 907-112
Table 7. Bill of material (continued)
Description Comment Designator Footprint Qty Supplier nameSupplier order
codeNote
www.BDTIC.com/ST
STM32F103 controller board - BOM UM0722
34/46 Doc ID 15867 Rev 1
Capacitor 0 Ω /22 nF C28 [0603] 1 GM Electronic 901-396
Typical red, green, yellow,
amber GaAs LED
LED_GREEN_0805
LED12012[0805]_TO_DIODE_wave
1 GM Electronic 960-023
RCA phono jack, right
angle, thru-hole, snap-in
RCA WBTOR 1 J1, J3 RCA/4.5-H2 2 Farnell (Lumberg) 1200146
Socket, 3.5 mm jack,
mono
Lumberg 1503 06
J4 JACK/6-V3A 1 Farnell (Lumberg) 1243243
InductorBLM18EG221S
N1L1, L2, L3, L4, L5, L6
1608[0603] 6 Farnell (Murata) 1515716
Header, 10-pin, dual
row, side mounting
Header 2 x 10 pin,
S2G20P1 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 2Farnell (PHOENIX CONTACT)
3041359
Resistor 10 KΩ
R1, R2, R7, R8, R9, R10, R13, R15, R20
[0603] 9 GM Electronic 901-399
Resistor 100 KΩ R3 [0603] 1 GM Electronic 901-529
Resistor 820 Ω R4, R5 [0603] 2 GM Electronic 901-500
Resistor 680 Ω R6 [0603] 1 GM Electronic 901-498
Resistor 1 KΩ R11, R12 [0603] 2 GM Electronic 901-502
Resistor 150 kΩ R14, R16 [0603] 2 GM Electronic 901-633
Resistor 68 Ω R17 [0603] 1 GM Electronic 901-408
Single supply stereo digital
audio line driver
ST: TS4657IQT U1 QFN20_TS4657 1 STMicroelectronics TS4657IQT
Table 7. Bill of material (continued)
Description Comment Designator Footprint Qty Supplier nameSupplier order
codeNote
www.BDTIC.com/ST
UM0722 STM32F103 controller board - BOM
Doc ID 15867 Rev 1 35/46
Filter-free stereo
2 x 2.8 W Class-D
audio power amplifier
ST: TS2012IQT U2 QFN20 - TS2012 1 STMicroelectronics TS2012IQT
2.8 W filter-free mono Class-D
audio power amplifier
ST: TS4962IQT U3 DFN8 - TS4962 1 STMicroelectronics TS4962IQT
Low noise microphone preamplifier
ST: TS472IQT U4 QFN24_TS472 1 STMicroelectronics TS472IQT
Microphone KEEG1542PBL U5 KEC2740 1 Farnell (KINGSTATE) 1502746
Transducer, speaker
KSSG1708 U6 KSS1708 1 Farnell (KINGSTATE) 1502738
Table 7. Bill of material (continued)
Description Comment Designator Footprint Qty Supplier nameSupplier order
codeNote
www.BDTIC.com/ST
STM32F103 controller board UM0722
36/46 Doc ID 15867 Rev 1
Appendix B STM32F103 controller board
Figure 26. STM32F103 controller board - top overlay
Figure 27. STM32F103 controller board - bottom overlay
www.BDTIC.com/ST
UM0722 STM32F103 controller board
Doc ID 15867 Rev 1 37/46
Figure 28. TS4657 audio card - top layer
Figure 29. TS4657 audio card - bottom layer
www.BDTIC.com/ST
TS4657 audio card - artwork prints UM0722
38/46 Doc ID 15867 Rev 1
Appendix C TS4657 audio card - artwork prints
Figure 30. TS4657 audio card - top overlay
Figure 31. TS4657 audio card - bottom overlay
www.BDTIC.com/ST
UM0722 TS4657 audio card - artwork prints
Doc ID 15867 Rev 1 39/46
Figure 32. TS4657 audio card - top layer
Figure 33. TS4657 audio card - bottom layer
www.BDTIC.com/ST
STM32F103 controller board - schematic UM0722
40/46 Doc ID 15867 Rev 1
Appendix D STM32F103 controller board - schematic
Figure 34. STM32F103 controller board - schematic - part 1
3.3
V
US
BD
PU
SB
DN
JTM
SJT
CK
JTD
I
JTD
OJT
RS
T
NR
ST
C9
100
nF
BU
TTO
N
R6
10 k
Ω
BO
OT
1
BO
OT
0B
OO
T0
60
NR
ST
7
OS
C_I
N/P
D0
5
OS
C_O
UT
/PD
16
PA0-
WK
UP
14
PA1
15
PA2
16
PA3
17
PA4
20
PA5
21
PA6
22
PA7
23
PA8
41
PA9
42
PA10
43
PA11
44
PA12
45
PA13
/JT
MS
/SW
DIO
46
PA14
/JT
CK
/SW
CLK
49
PA15
/JT
DI
50
PB
026
PB
127
PB
2/B
OO
T1
28
PB
3/JT
DO
55
PB
4/JN
TR
ST
56
PB
557
PB
658
PB
759
PB
861
PB
962
PB
1029
PB
1130
PB
1233
PB
1334
PB
1435
PB
1536
PC
08
PC
19
PC
210
PC
311
PC
424
PC
525
PC
637
PC
738
PC
839
PC
940
PC
1051
PC
1152
PC
1253
PC
13-T
AM
PE
R-R
TC
2
PC
14-O
SC
32_I
N3
PC
15-O
SC
32_O
UT
4
PD
254
VB
AT1
VD
D_1
32
VD
D_2
48
VD
D_3
64
VD
D_4
19
VD
DA
13
VS
S_1
31
VS
S_2
47
VS
S_3
63
VS
S_4
18
VS
SA
12
U1
ST
M32
F10
3RE
T6
I2S
2_W
SI2
S2_
CK
I2S
2_S
D
I2S
2_M
CK
PC
0P
C1
PC
2P
C3
PA0
PA1
PA2
PA3
I2C
1_S
CL
I2C
1_S
DA
C15
100
nF
10 n
H
L1 Indu
ctor
3.3
V
A 3
.3 V
SP
I1_S
CK
SP
I1_M
OS
I
SP
I1_N
SS
SP
I1_M
ISO
VS
SA
R8
0 Ω
US
B_A
CT
IVIT
YLE
D_A
CT
IVE
VS
SA
X1
X2
Inte
rnal
pul
l-up
Inte
rnal
pul
l-up
Inte
rnal
pul
l-up
Inte
rnal
pul
l-dow
n
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
CN
1M
LW20
G3.
3 V
R2
10 K
Ω
R14
10 K
Ω
R1
10 K
ΩR
TC
K
DB
GR
Q
DB
GA
CK
JTR
ST
JTD
I
JTM
S
JTC
K
JTD
O
NR
ST
AM
0049
1
www.BDTIC.com/ST
UM0722 STM32F103 controller board - schematic
Doc ID 15867 Rev 1 41/46
Figure 35. STM32F103 controller board - schematic - part 21
23
45
67
89
1011
1213
1415
1617
1819
20
P2
BL2
20G
PC
0P
C1
PC
2P
C3
PA0
PA1
PA2
PA3
I2S
2_M
CK
US
B 5
V
3.3
V
A 3
.3 V
I2C
1_S
CL
I2C
1_S
DA
I2S
2_W
SI2
S2_
CK
I2S
2_S
DV
SS
A
AM
0049
3
2 1
B1
C7
100
nF
BU
TTO
N
3.3
V R10
10 k
Ω
C11
100
nF
3.3
V
C12
100
nF
C13
100
nF
C14
100
nF
122.
3 V
LD1
GM
E 96
0-02
4
3.3
V
LED
_AC
TIV
E1
2LD2
R13
220
Ω
R12
470
ΩU
SB
_AC
TIV
ITY
3.3
V
3.3
V
C16
100
nFR
910
KΩ
3.3
V
HO
LD7
VC
C8
S1
Q2
W3
VS
S4
D5
C6
U3
M25
P64
-VM
E6G
SP
I1_S
CK
SP
I1_M
OS
IS
PI1
_NS
SS
PI1
_MIS
O
C8
33 p
F
C10
33 p
F
X1
X2
123
4
GN
D
GN
DX
1
TS
X-3
225
/ 16
MH
z
C1
4.7µ
F3. 3
VU
SB
5 V
C2
1µF
C3
1µF
VIN
1
GN
D2
INH
B3
VO
UT
5
BY
PAS
S4
U2
LD39
85X
X33
C4
10 n
F
C5
4.7µ
F
US
BD
N
US
BD
P
US
B 5
V
R7
1 M
Ω
C6
4.7
nF
VB
US
1
D–
2
D+
3
GN
D4
SH
15
SH
26
US
B_A
CN
2U
SB
1X90
A P
CB
R4
4.7
Ω
R5
4.7
Ω
R3
1.5
kΩ3.
3 V
I/O1
1
GN
D2
I/O2
3I/O
24
VB
US
5I/O
16
U4
US
BLC
6-2P
6
US
B 5
V
www.BDTIC.com/ST
TS4657 audio card - schematic UM0722
42/46 Doc ID 15867 Rev 1
Appendix E TS4657 audio card - schematic
Figure 36. TS4657 audio card - schematic - part 1
5 V D
AC
_SD
AT
DA
C_B
CL
K
DA
C_M
CLK
DA
C_F
MT
2D
AC
_FM
T1
DA
C_L
RC
L K
ST
BY
_RS
TB
Y_L
G0
G1
SP
K_ST
BY
MIC
RO
_OU
TM
ICR
O_S
HD
N
DA
C_S
TB
YGN
D
12
34
56
78
910
1112
1314
1516
1718
1920
P1
VC
CA
GN
D
GN
DA
Con
trol
ler
boar
d co
nnec
tor
100
nFC16
10 µ
F /
16 V
C26
GN
D
5 V
LED
1
LED
_GR
EE
N_0
805
680
ΩR
6
GN
D
5 V
100
nF
C34
10 µ
F /
16 V
C35
GN
D
5 V
10 µ
F /
16 V
C36
GN
D
5 V
AM
0049
4
12
KE
EG
1542
PB
L
U5
MIC
RO
_OU
T
Mic
roph
one
1 K
ΩR
11
1 K
ΩR
12
10 K
ΩR
15
100
nFC
17
100
nF
C19
100
nF
C20
100
pF
C18
100
pF
C23
MIC
RO
_SH
DN
VC
CA
GN
DA
GN
DA
GN
DA
1617
20
Bia
s
G 21
58
IN–
IN+
GN
DG
ND
15 C1
OU
T+
OU
T–
4
14 C2
Bia
s2.
0 V
VC
C
ST
BY
10
9 2
22
BY
PS
GA
IN
ST
: TS
472I
QT
U4
VC
CA
GN
DA
C27
1 µ
F
GN
DA
0 Ω
/ 22
nF
C28
: ass
embl
y 0
Ω re
sist
or
for
DC
cou
plin
g
C28
C29
1 µF
GN
DA
100
KΩ
R3
GN
DA
Mic
roph
one
prea
mpl
ifier
68 Ω
R17
GN
DA
www.BDTIC.com/ST
UM0722 TS4657 audio card - schematic
Doc ID 15867 Rev 1 43/46
Figure 37. TS4657 audio card - schematic - part 2
Gai
nse
lect
Gai
nse
lect
Sta
ndby
cont
rol
192015 11716
7 8
111452
93 4
1812
PW
MH
brid
ge
PW
MH
brid
ge
Osc
illat
or
13
RIN
+
RIN
–
L IN–
L IN+
G0
G1
ST
BY
L
ST
BY
R
AV
AG
ND
PG
ND
PG
ND
L OU
T+
L OU
T–
CC
PV
CC
PV
CC
RO
UT
+
RO
UT
–
21
E-P
AD
ST
: TS
2012
IQT
U2
5 V
5 V
5 V
ST
BY
_R
ST
BY
_LG0
G1
21
KS
SG
1708
U6
Spe
aker
RC
A W
BTO
R 1
J1
RC
A W
BTO
R 1
J3
Ext
erna
l
150
KΩ
R16
100
nF
C22
150
KΩ
R14
100
nF
C21
5 V
SP
K_S
TB
Y
C24
1 µF
5 V
Cha
nnel
sta
ndby
220
nF
C11
220
nFC12
220
nF
C13
220
nF
C15
100
nF
C25
Out
put
85
6
Osc
illat
or
PW
M
1 43
IN–
IN+
ST
BY
GN
DA
7
VC
CA
Hbr
idge
Inte
rnal
bias
OU
T+
OU
T–
300
KΩ
150
KΩ
150
KΩ
2NC
9
E-P
AD
ST
: TS
4962
IQT
U3
10 K
ΩR
13
GN
D
GN
DG
ND
GN
D
GN
D GN
DG
ND
GN
D
GN
D
10 K
ΩR9
10 K
ΩR
10
GN
DG
ND
GN
D
GN
D
spea
kers
Lum
berg
1
503
06
J4
Mon
o ja
ck
10 K
ΩR
2
10 K
ΩR
1GN
DG
ND
Gai
n co
ntro
l
1 2Te
rmin
albl
ock
P2 12
Term
inal
bloc
k P3
L1
BLM
18E
G22
1SN
1
100
pFC
9100
pFC
8
100
pFC
30
100
pFC
31
GN
D
GN
D
GN
D
100
pFC
32
100
pFC
33
GN
D
GN
D
L2
BLM
18E
G22
1SN
1
L3
BLM
18E
G22
1SN
1
BLM
18E
G22
1SN
1
L4
L5
BLM
18E
G22
1SN
1
L6
BLM
18E
G22
1SN
1
Mon
o C
lass
-D a
mpl
ifier
Ste
reo
Cla
ss-D
am
plifi
er
AM
0049
2
DA
CLO
UT
DA
CR
OU
T
www.BDTIC.com/ST
TS4657 audio card - schematic UM0722
44/46 Doc ID 15867 Rev 1
Figure 38. TS4657 audio card - schematic - part 3
115
DA
C
DA
C1112
LDO
LDO
NC
P
PC
P
1413
Con
trol
inte
rfac
e
Dig
ital
audi
o
inte
rfac
e
Dig
ital
filte
rs
18
202
7 86543
19
9
MC
LK
BC
LK
FM
T1
FM
T2
SD
AT
LRC
LK
ST
DB
Y
17
GN
DD
GN
DD
GN
DA
10
GN
DA
GN
DA
16
VC
CA
VC
CD
VR
EG
AV
RE
GD
21E-P
AD
RO
UT
L OU
T
U1
820
Ω
R4
820
Ω
R5
2.2
nFC
10 2.2
nFC
14
1 µFC1
1 µFC2
1 µFC3
1 µFC4
DA
C
GN
D
GN
D
GN
D
GN
DG
ND
GN
D
5 V
5 V
DA
C_S
TB
Y
DA
C_S
DAT
DA
C_B
CL
K
DA
C_M
CL
K
DA
C_F
MT
2
DA
C_F
MT
1
10 K
ΩR7
10 K
ΩR
8
GN
DG
ND
DA
C_L
RC
LK
10 K
Ω
R20
GN
D
+ – + –
AM
0049
5
DA
CLO
UT
DA
CR
OU
T
C6
1 µF
5 V
100
nF
C7
GN
DG
ND
GN
D
C5
1 µF
www.BDTIC.com/ST
UM0722 Revision history
Doc ID 15867 Rev 1 45/46
Revision history
Table 8. Docsument revision history
Date Revision Changes
27-Aug-2009 1 Initial release.
www.BDTIC.com/ST
UM0722
46/46 Doc ID 15867 Rev 1
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve theright to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at anytime, 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 noliability 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 thisdocument 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 productsor services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of suchthird 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 IMPLIEDWARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIEDWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWSOF 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 NOTRECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAININGAPPLICATIONS, 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 "AUTOMOTIVEGRADE" 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 voidany warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, anyliability 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
www.BDTIC.com/ST