DM00073270

AN4227

Application note

Audio hub demonstration kit supporting the MP45DT02,

MP34DB01, and MP34DT01 microphones

Introduction

This document provides a brief description of the audio hub demonstration board STEVAL-

MKI138V1 available from

www.st.com

along with simple steps to use the board with the

APWorkbench software tool.

The purpose of this board is twofold:

1.

It can be used as an STSmartVoice interface. In combination with this board

(STEVAL-MKI126Vx), it manages the signal coming from the onboard microphones.

The STSmartVoice board hosts up to six microphones and the STA321MPL microphone processor converts the PDM signals from them into the common I

2

S audio format. (For additional details, please refer to AN4146 “STSmartVoice demonstration board STEVAL-MKI126Vx” available from

www.st.com

). Basically the audio hub, using

I the STM32F107RC microcontroller, is able to program the STA321MPL device via the

2

C and decodes the I

2

S into a USB stream in order for the PC to manage the sound captured by the microphones. Multiple features for using the microphones on the

STSmartVoice demonstration board are listed and accessible thanks to the

APWorkbench software tool.

2. It can be used as a USB sound card. As shown in

Figure 1

, the audio hub board hosts

either the MP45DT02 or MP34DT01 (top-port digital microphones) and the MP34DB01 which is a bottom-port digital microphone. The board is able to host both types of microphones as shown below. The task of the STM32 microcontroller is to decode the

PDM signals coming from the microphones and stream the audio via the USB.

Figure 1. STEVAL-MKI138V1

March 2013

MP45DT02

Entire board (top and bottom views)

MP34DB01

MP34DT01

Microphone section (zoom)

DocID024106 Rev 1 1/13

www.st.com

Contents

Contents

AN4227

1

2

Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Software description (getting started with APWorkbench) . . . . . . . . . . 6

2.1

STSmartVoice interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.2

USB voice recorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Appendix A Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Appendix B Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2/13 DocID024106 Rev 1

AN4227 Hardware description

The connection is done through a USB cable that supplies the board and also streams the audio collected by the microphones to the PC.

Figure 2. Block diagram - microphone USB demonstration board

ST Audio HUB

12.288 MHz

Mic_Vdd

SEL

Mic_Vdd

MCLK

MIC_CK

Vdd

Clk

L/R gnd

Out

MIC_DATA12

J1

SEL

Mic_Vdd SPI_CK

I2C I2S

STM32F107RC

SPI MCO

Timer

µC_Vdd

Out gnd

Vdd

Clk

L/R

SEL

J5

Mic_Vdd

MIC_CK

3.3V

USB I/F OSC 12.288 MHz

µC_Vdd

Mic_Vdd

Regulator

3.3V

5V

USB

Connector

D1 D2 D3 D4 D5

Referring to

Figure 2

:

• The supply section of the board is made up of one voltage regulator that steps down the 5 V of the USB connection to 3.3 V. The supply voltage ranges of the digital microphones are given below in

Table 1

.

Part number

Table 1. Supply voltage range of microphones

Min.

Typ.

MP45DT02

MP34DB01

MP34DT01

1.64

1.8

1.64

1.8

1.64 1.8

Max.

3.6

3.6

3.6

Regarding the microphone sections, the MEMS outputs are a PDM signal, which is a high-frequency (1 to 3.25 MHz) stream of 1-bit digital samples. The “Functionality” section of each microphone datasheet (available on

www.st.com

) provides details concerning the connections of the microphone in single channel configuration or stereo configuration by setting the LR pin. This pin sets the validity of the output data on the high level of the clock or on the low level as shown in

Table 2

.

L/R

GND

VDD

Table 2. L/R channel selection

Clock low

Data valid

High impedance

Clock high

High impedance

Data valid

DocID024106 Rev 1 3/13

Hardware description AN4227

In this board the microphones are used in stereo configuration, so the two digital outputs are shorted (Mic_DATA12, refer to schematic) and the two MEMS LR pins must be respectively set one to GND and the other one to VDD. On the board, the resistors R1 and R13 already set the LR pin of the microphones, R1 and R42 give the user the possibility to change the

MEMS polarity. Note that the PCB sections hosting the MEMS microphones are detachable.

This option has been considered to let the user put the microphones in the desired position

(i.e. for a display application in which the microphones are placed at the edges of the display).

The hardware relative to the STM32F107RC microcontroller has been chosen to support both modes of usage listed above (either STSmartvoice interface or USB sound card).

The board hosts two clock devices, the first one is a crystal quartz at 12.288 MHz and the other one is an active oscillator at 12.288 MHz as well. The first one, connected to the OSC_IN and OSC_OUT pins, serves to generate the entire internal clock of the microcontroller (STM32 clock tree). Once the clock tree has been set, all the internal peripherals of the microcontroller have their own clocks.

If the ST audio hub is used as the STSmartVoice interface, the internal clock tree provides the clock for the USB, for the I

2

C cell, for the I

2

S cell and also provides the clock for the daughterboard through the MCO pin (12.288 MHz as well). The microcontroller is used to program the STA321MPL via I

2

C and also is used to decode the I

2

S coming from the daughterboard and to stream the audio via the USB. For this reason dedicated STM32 pins are connected to the connector physically interfacing the

STSmartVoice board. An additional clock device (active oscillator) has been mounted for debugging purposes only. In the default configuration, the selector composed of

R42, R21, and R17 is set to connect the MCLK trace to the MCO pin (refer to the schematic).

If the ST Audio hub is used as a USB sound card, the clock tree is used to provide the

MIC_CK and SPI_CK thanks to internal timers and a dedicated loop trace on the board

(short between pin 21 and pin 27). The STM32 samples the output data of the microphones using the synchronous serial port (SPI1). The microphone signal

MIC_DATA12 is a stereophonic signal and the SPI must be able to sample both channels. Since MIC_DATA12 is synchronous with its clock, SPI_CK must be doubled.

Summarizing, the timer generates:

– MIC_CK = 3.072 MHz

– SPI_CK = 6.144 MHz

The supported microcontroller USB interface allows streaming the audio on the USB peripheral, rendering this demonstration board compatible with any laptop or desktop.

4/13 DocID024106 Rev 1

AN4227 Hardware description

Some LEDs have been mounted on the board, thus allowing a real-time check of what the demonstration board is performing. LEDs D1 and D5 give feedback about the supply and successful enumeration while the purpose of D2, D3 and D4 is to check the status of the board. D2 and D3 will alternately blink while the STM32 is in DFU mode

(before the dedicated firmware has been correctly loaded into the flash memory of the microcontroller). Checking the PC “Device Manager”, the STM device in DFU mode will appear (see

Figure 3

below).

Figure 3. Device manager when STM32 is in DFU mode

D1

ON: USB enumeration successful

The audio hub boards are provided by ST with the firmware already loaded; the DFU section has been included to allow a firmware update by the user with no need for flash loader kits and is directly supported by the APWorkbench tool. The status of LEDs D1-D5 is summarized in the table below.

D2

Table 3. LED status

D3 D4 D5

Blinking: DFU mode

Off: Firmware correctly downloaded

Blinking: DFU mode

Off: Firmware correctly downloaded

Off: Firmware correctly downloaded

ON: Board supplied

DocID024106 Rev 1 5/13

Software description (getting started with APWorkbench)

2 Software description (getting started with

APWorkbench)

AN4227

The firmware of the ST audio hub supports two different audio frameworks. In the first case the board can be used as the interface for the STSmartVoice, allowing the I

2

C programming and the decoding of the I

2

S coming from the daughterboard. When the board is used for this purpose, it will be recognized as "STAudioHub interface"

(a)

. The other possibility is the use of the board essentially as a PDM decoder that allows the couple of microphones on the board to be interfaced directly to the PC via the USB in which case the board will be recognized by the operative system as "STM32 Capture PDM mode".

The APWorkbench tool allows choosing one of these modes by following these simple steps:

1.

Run the tool

2. Click on the "MEMS Microphones Demo Kit" button

3. Select the mode in the "Microphone Kit selection" box

4. Click on the "Run Selected Application…" button

If the user wants to operate the board as the STSmartVoice interface, the corresponding

mode must be selected as shown in

Figure 4

.

Figure 4. APWorkbench launch wizard (STSmartVoice demonstration kit)

6/13 a. APWorkbench is compatible with Windows XP, Windows Vista and Windows 7.

DocID024106 Rev 1

AN4227 Software description (getting started with APWorkbench)

After this selection, the setup wizard panel of the STSmartVoice supported configurations

will appear. For a detailed description of the meaning of the configurations listed in

Figure 5

,

please refer to AN4146 "STSmartVoice demonstration board STEVAL-MKI126Vx" available on

www.st.com

.

Figure 5. STSmartVoice - setup wizard

DocID024106 Rev 1 7/13

Software description (getting started with APWorkbench)

2.2 USB voice recorder

AN4227

If the user wants to operate the board as a USB voice recorder, the proper mode must be selected as depicted in

Figure 6

.

Figure 6. APWorkbench launch wizard (USB digital voice recorder)

Once this selection has been run, a dedicated panel will appear. If the user wants to operate the board as a USB voice recorder, the tool shows the panel performing either FFT or scope monitoring. It is also possible to record the signal sensed by the microphones on the board.

Figure 7. USB voice recorder - FFT monitoring

8/13 DocID024106 Rev 1

Appendix A Schematics

Figure 8. Board schematic (power supply and JTAG connector)

<Power Supply>

UC_VDD VCC_USB UC_VDD

USB_DISC

J7

VBUS

D-

D+

ID

GND

Mini TypeB

3

4

5

1

2

VCC_USB

1

R24

1K

2

1

2

R25

47k

B

C

E

1

2

R23

10k

B

Q2

1

2

R22

36k

1 I/O1

2 GND

3 I/O2

U8

I/O1 6

VBUS 5

I/O2 4

USBLC6-2

C5

100nF

2

R6 22

1

2

R12 22

1

C

E

Q1

1

2

R27

0R0 NC

1

R26

180

2

1

2

R8

1.5K

USBDM

USBDP

D1

LED-1

VCC_USB

1

L3

INDUCTOR2

2

BEAD

R38

1k

C41

10nF

D5

LED-1

C40

33uF

+

C39

100nF

U4

LD1117

C3

10uF

+

3.3V

C49

100nF

L6

1

1

BEAD

L1

2

BEAD

2

L4

1 2

BEAD

UC_VDD

A_VDD

MIC_VDD

<JTAG>

UC_VDD

JTCK

NRST

JRST

R2

10K

1

2

R3

10K

1

2

R4

10K

1

2

STM32_I2S_BICK

STM32_I2S_LRCK

2

JP3

JP

1

R15

10K

1

2

JTMS

4

6

5X2_HEADER

2 1

8

3

5

7

10 9

J2

UC_VDD

Figure 9. Board schematic (STM32 microcontroller, Mangusta option, clock generators, connectors, and microphones)

<uController STM32>

A_VDD

1

2

R30

100

D2

LED-1

UC_VDD

1

L2

820nH

2

C10

10uF

1

L5

BEAD

2

1

2

R31

100

D3

LED-1

1

2

R32

100

D4

LED-1

UC_VDD

C1

100nF

R5

10K

1

UC_OSC_IN

2

UC_OSC_OUT

NRST

C4

100nF

RESET

STBY

MUTE

FAIL

C9

100nF

LED1

MIC_CK

LED2

C17

100nF

LED3

UC_VDD

C11

100nF

UC_VDD

C18

4.7uF

1

R33

10K

R35

1k

2

R34

1k

1 VBAT

2 PC13-TAMPER-RTC

3 PC14-OSC32_IN

4 PC15-OSC32_OUT

5 PD0_OSC_IN

6 PD1_OSC_OUT

7 NRST

8 PC0

9 PC1

10 PC2

11 PC3

12 VSSA

13 VDDA

14 PA0-WKUP

15 PA1

16 PA2

UC_VDD

C12

4.7uF

UC_VDD UC_VDD

U5

<Mangusta option>

VSS_CAP

2

R39

0R0 NC

1

C28

2.2uF

C29

2.2uF

STM32_LQFP64

STM32_I2S_DATA34

STM32_I2S_BICK

STM32_I2S_LRCK

SDA

SCL

JRST

MCO

JTCK

UC_VDD

C15

100nF

VDD_2

48

VSS_2

47

PA13

46

PA12

45

PA11

44

PA10

43

PA9

42

PA8

41

PC9

40

PC8

39

PC7

38

PC6

37

PB15

36

PB14

35

PB13

34

PB12

33

UC_VDD

2

R14

0R0

1

C16

4.7uF

JTMS

USBDP

USBDM

USB_DISC

VSS_CAP

MCO

TP2

TP3

STM32_I2S_MCLK

STM32_I2S_MCLK

STM32_I2S_DATA12

STM32_I2S_BICK

STM32_I2S_LRCK

<Clock Generators>

UC_VDD

1

2

R37

10k

1

U3

2

3

XT_ACTIVE

4

12.288_CK

UC_OSC_IN

UC_OSC_OUT

C27

100nF

<Connectors>

R18

0R

3.3V

I2S_DAT_12

SCL

MUTE

I2S_DAT_56

I2S_BICK

2

R20100

1

MCLK

MIC_VDD

C6

NS

MCO

STM32_I2S_MCLK

12.288_CK

C2

18pF

Y1

12.288MHz

C31

18pF

1

3

5

7

9

11

13

15

C7

10pF

J15

2

4

6

8

10

12

14

16

J8

CON4

MIC_CK

MIC_DATA12

MIC_VDD

J6

CON4

12.288_CK

R16

0R NS

TP1

SPI1_Clock

MIC_DATA12

C14

4.7uF

C13

100nF

VSS_CAP

2

R36

0R0

1

I2S_DAT_12

I2S_DAT_34

I2S_BICK

I2S_LRCK

2

0R0 R9

1

2

0R0 R7

1

2

0R0 R11

1

2

0R0 R10

1

STM32_I2S_DATA12

STM32_I2S_DATA34

STM32_I2S_BICK

STM32_I2S_LRCK

I2S_DAT_34

I2S_LRCK

2

R19 100

1

SDA

FAIL

RESET

STBY

C8

10pF

J10

CON4

J9

CON4

<Microphones>

U7

MIC_VDD

3

VDD

4

DATA

MIC_DATA12

MP34DB01

L/R

CLK

MIC1CK

MIC_DATA12

3 CLK

4 DATA

U10

2

1

MIC_VDD

L/R

2

MIC1LR

R13

MIC1LR

0R

R42

0R NS

VDD

1

MIC_VDD

MP34DT01

1

2

3

U2

GND

LR

GND

VDD

DOUT

CLK

MP45DT01

MIC_CK

MIC_DATA12

MIC_VDD

MIC_DATA12

MIC_VDD

R1

0R NS

MIC2LR R41

0R

1

U1

GND

2

LR

3

4

U9

VDD

DATA

L/R

CLK

2

1

3

GND CLK

MP45DT01

MP34DB01

MIC2CK

6

5

4

C26

15pF

VDD

6

DOUT

5

4

C20

15pF

MIC_VDD

C24

10uF

2

R28

100

1

MIC_DATA12

MIC1CK

MIC_CK

MIC_VDD

C22

10uF

C23

100nF

C21

100nF

2

C19

15pF

R29

100

1

MIC_DATA12

MIC2CK

MIC_CK

3 CLK

4 DATA

U11

L/R

2

VDD

1

MP34DT01

MIC2LR

MIC_VDD

AN4227

Appendix B Layout

Figure 10. Board layout - top view

Layout

Figure 11. Board layout - bottom view

DocID024106 Rev 1 11/13

Revision history

Date

22-Mar-2013

Revision

Table 4. Document revision history

Changes

1 Initial release.

AN4227

12/13 DocID024106 Rev 1

AN4227

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.

ST PRODUCTS ARE NOT AUTHORIZED FOR USE IN WEAPONS. NOR ARE ST PRODUCTS DESIGNED OR AUTHORIZED FOR USE

IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH

PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR

ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED

FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN

WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR “AUTOMOTIVE,

AUTOMOTIVE SAFETY OR MEDICAL” INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS.

PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE

CORRESPONDING GOVERNMENTAL AGENCY.

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.

© 2013 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

DocID024106 Rev 1 13/13

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project