AN4041 Application note - STMicroelectronics · Microphone USB demonstration board (block diagram)...

14
September 2012 Doc ID 022706 Rev 2 1/14 AN4041 Application note APWLink+ microphone USB demonstration boards based on the MP34DT01, MP45DT02, or MP34DB01 Introduction The purpose of this application note is to give a brief description of the APWLink+ microphone USB demonstration boards from STMicroelectronics. These boards host the microcontroller STM32F107RC and either the MP45DT02, MP34DT01 (top-port digital microphones) or the MP34DB01 (bottom-port digital microphone). Figure 1 shows the capability of the board to host these microphones. These microphones are analog-to-digital transducers, in other words, they are able to sense sound pressure and convert this signal to a digital signal using the pulse-density modulation (PDM) technique. The STM32 microcontroller decodes the PDM signal coming from the microphones and streams the audio via the USB. This document will provide a brief description of the software that decodes the PDM signal and also information about the hardware as well as simple steps to use the boards. Ordering information for these boards can be found in Appendix C on page 12. Figure 1. APWLink+ demonstration board www.st.com

Transcript of AN4041 Application note - STMicroelectronics · Microphone USB demonstration board (block diagram)...

September 2012 Doc ID 022706 Rev 2 1/14

AN4041Application note

APWLink+ microphone USB demonstration boards based on theMP34DT01, MP45DT02, or MP34DB01

IntroductionThe purpose of this application note is to give a brief description of the APWLink+ microphone USB demonstration boards from STMicroelectronics. These boards host the microcontroller STM32F107RC and either the MP45DT02, MP34DT01 (top-port digital microphones) or the MP34DB01 (bottom-port digital microphone). Figure 1 shows the capability of the board to host these microphones.

These microphones are analog-to-digital transducers, in other words, they are able to sense sound pressure and convert this signal to a digital signal using the pulse-density modulation (PDM) technique. The STM32 microcontroller decodes the PDM signal coming from the microphones and streams the audio via the USB.

This document will provide a brief description of the software that decodes the PDM signal and also information about the hardware as well as simple steps to use the boards. Ordering information for these boards can be found in Appendix C on page 12.

Figure 1. APWLink+ demonstration board

www.st.com

Contents AN4041

2/14 Doc ID 022706 Rev 2

Contents

1 Software description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Appendix A Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

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

Appendix C Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

AN4041 List of tables

Doc ID 022706 Rev 2 3/14

List of tables

Table 1. Microphone supply voltage range. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Table 2. L/R channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Table 3. Ordering information for demonstration boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 4. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

List of figures AN4041

4/14 Doc ID 022706 Rev 2

List of figures

Figure 1. APWlink+ demonstration board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Figure 2. DSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Figure 3. Microphone USB demonstration board (block diagram) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Figure 4. Windows message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Figure 5. Computer management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Figure 6. Recording properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 7. Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 8. Board layout - top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Figure 9. Board layout - bottom view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

AN4041 Software description

Doc ID 022706 Rev 2 5/14

1 Software description

The digital signal processing (DSP) consists of the simple flow depicted in the figure below.

Figure 2. DSP

The PDM signal from the microphone is filtered and decimated in order to obtain a sound signal at the required frequency and resolution. The loaded firmware implements a filter pipeline that has been designed as two filtering-decimation stages.

Assuming an input frequency of 3.072 MHz and a desired output frequency of 48 kHz, the filter stages are configured to implement a decimation factor of 64. The final gain of the pipeline is therefore G1 = 7.8125. As a result, the output of the filter pipeline is a 16-bit pulse-code modulated (PCM) signal.

For further information, please refer to application note AN3998, “PDM audio software decoding on STM32 microcontrollers” available on www.st.com.

Hardware description AN4041

6/14 Doc ID 022706 Rev 2

2 Hardware description

The board is a sound card automatically recognized by the PC as an audio device. The connection is done through the USB cable which also supplies the board and then streams the audio collected from the microphones to the PC.

Figure 3. Microphone USB demonstration board (block diagram)

Supply section

The supply section of the board is made up of two voltage regulators that step down the 5 V of the USB connection to 3.3 V and 2.5 V. The solder jumper J4 gives the user the possibility to choose the desired supply voltage.The digital microphone voltage ranges are given in the following table.

We recommend using 2.5 V to avoid supplying the microphone with a voltage that is too high. For instance, the MP34DT01 cannot support a supply voltage of 3.3 V.

Microphone section

Regarding the microphone section, the MEMS outputs are a PDM signal, which is a high-frequency stream (1 to 3.25 MHz) of 1-bit digital samples. According to the application hints given in the datasheets (available on www.st.com), the microphone can be used in single-channel configuration or stereo configuration by setting the LR pin. This pin sets the validity

Table 1. Microphone supply voltage range

Part number Min. Typ. Max. Unit

MP45DT02 1.64 1.8 3.6 V

MP34DB01 1.64 1.8 3.6 V

MP34DT01 1.64 1.8 3.6 V

SDA

SCL

LRC

K

BIC

K

SDO

12

SDO

34

SDO

56

STM32F107RC 12.288 MHz

SEL

L/R

Clk

Vdd

Out

gnd

APWlink connector

I2S

SPI

I2C

USB I/F 8 MHz

L/R

Clk

Vdd

Out

gnd

SEL

Regulator 2.5V

Regulator 3.3V

SEL

5V

Mic_Vdd

µC_Vdd

USB Connector

2.5V 3.3V

OSC

Mic_Vdd

J4

J1 J5

SPI_CK

APWlink+

Timer MIC_CK MIC_CK

MIC_DATA12

Mic_Vdd

D1 D2 D3 D4 D5

Mic_Vdd Mic_Vdd

µC_Vdd

AN4041 Hardware description

Doc ID 022706 Rev 2 7/14

of the output data on the high level of the clock or on the low level, refer to the following table.

On this board the microphones are used in stereo configuration, so the two digital outputs are shorted (Mic_DATA12, refer to the schematic) and the two MEMS LR pins must be set one to GND and the other one to VDD. On the board, the resistors R1 and R13 have already set the LR pin of the microphones. In order to change the MEMS polarity, the user must unsolder these resistors and manually set the LR pin using the solder jumper J1 and J5. Note that the PCB section mounting the MEMS microphones is detachable. This option has been implemented in order to let the user put the microphones in the desired position (i.e. for display applications in which the microphones are placed at the edges of the display).

Microcontroller

The STM32F107RC microcontroller simultaneously works as a PDM interface and also supports the USB audio streaming. The board hosts two external clocks, the 12.288 MHz and 8 MHz. The first one serves to clock an internal timer for generating both MIC_CK and SPI_CK. The 8 MHz is the microcontroller’s external clock connected to the OSC_IN OSC_OUT pins.

The STM32 samples the microphone’s output data by 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

Finally, the USB interface allows streaming the audio on the USB peripheral making this demonstration board compatible with any laptop or desktop. This streaming capability allows using any acoustic tool for the sound acquisition done by STMicroelectronics’ MEMS microphones. The demonstration board also has the possibility to manage the microcontroller registers using the I2C bus. Another important STM32 peripheral that is used is the I2S which allows exporting the audio in the most commonly used digital format. This allows the user to test the signal using audio testing equipment such as Audio Precision. All these signals can be monitored on the APWLink connector.

LEDs D1-D5

The status of the board is indicated by the following LEDs:

● D1 on: USB enumeration successful

● D2 on: Firmware correctly downloaded

● D3 off: Firmware correctly downloaded

● D4: not soldered

● D5 on: Board supplied

Table 2. L/R channel selection

L/R Clock low Clock high

GND Data valid High impedance

VDD High impedance Data valid

Getting started AN4041

8/14 Doc ID 022706 Rev 2

3 Getting started

The demonstration board is very user-friendly and is ready to use. After connecting the micro USB cable to the laptop or desktop, the message shown in Figure 4 below appears. This is possible since the firmware loaded into the STM microcontroller allows the operating system to recognize the peripheral as an audio device. The version (in this case v1.0) indicates the firmware loaded. The version v1.0 refers to a software decimator of 48 kHz as the sampling frequency and 64 as the decimator index.

Figure 4. Windows message

The user can also check if the USB demonstration board is recognized as an audio device by accessing the computer management and then clicking on the device manager. The demonstration board appears as a USB audio device in the list below.

Figure 5. Computer management

AN4041 Getting started

Doc ID 022706 Rev 2 9/14

Since the firmware is able to let the operating system recognize the peripheral as an audio device, it is possible to set the "ST 2uPhones EVB_v1.0" evaluation board as the recording device. In this configuration, the demonstration board can be used to record the input of general-purpose acoustic tools.

Figure 6. Recording properties

AN

4041S

chem

atic

Doc ID

022706 Rev 2

10/14

Appendix A Schematic

Figure 7. Schematic

<JTAG>

<Connectors>

<Microphones>

<Power Supply>

<uController STM32> <Mangusta option> <Clock Generators>

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

17PA

3

18VSS

_4

19VDD_4

20PA

4

21PA

5

22PA

6

23PA

7

24PC

4

25PC

5

26PB

0

27PB

1

28PB

2

29PB

10

30PB

11

31VSS

_1

32VDD_1

33PB12

34PB13

35PB14

36PB15

37PC6

38PC7

39PC8

40PC9

41PA8

42PA9

43PA10

44PA11

45PA12

46PA13

47VSS_2

48VDD_2

49PA

14

50PA

15

51PC

10

52PC

11

53PC

12

54PD

2

55PB

3

56PB

4

57PB

5

58PB

6

59PB

7

60BO

OT0

61PB

8

62PB

9

63VSS

_3

64VDD_3

U5

STM32_LQFP64

12R70R0

12R90R0

12R100R0

12R110R0

1

2

R210K

1

2

R310K

1

2

R410K

1 IN

2 OUT1

3 OUT2

4 ADJ

8

7OUT4

6OUT3

5

U6

LM317LMC491uF

1 2R44

1K

1 2R47

1.6K

1 2

L3INDUCTOR2

BEAD

12

D5LED-1

C4110nF

1

2

R3827

C39100nF

+C40

33uF

1 2

L1INDUCTOR2

BEAD

C1100nF

1

2

R510K

C4100nF

12

BUT1

TACT2

C5100nF

12R6 22

12R12 22

1

2

R1510K

1 2

3 4

5 6

7 8

9 10

11 12

13 14

15 16

J15

12

JP1JP

12R19 100

12

R20100

C6NS

12R210R0

C710pF

C810pF

1 2

L2820nH

C9100nF

C1010uF

C11100nF

C124.7uF

C13100nF

C144.7uF

C15100nF

C164.7uF

C17100nF

C184.7uF

1

2

R81.5K

E

B

C

Q1

E

B

C

Q2

1

2

R2236k

1

2

R2310k

1 2R24

1K

1

2

R2547k

1 2R26

180

12

D1LED-1

1

2

R270R0 NC

1 GND

2 LR

3 GND

6VDD

5DOUT

4CLK

U1

MP45DT01

C21100nF

C2210uF

12

R29100C19

15pFC20

15pF

1 GND

2 LR

3 GND

6VDD

5DOUT

4CLK

U2

MP45DT01

C23100nF

C2410uF

12

R28100

C2515pF

C2615pF

1

2

R30100

12

D2LED-1

1

2

R31100

12

D3LED-1

1

2

R32100

12

D4LED-1

1 2

L4INDUCTOR2

BEAD

1

2

R341k

1

2

R351k

1 2

3 4

U3

XT_ACTIVE

1

2

R3710k

C27100nF

1

2

3

J5

JUM

PER_3

P

1

2

3

J1

JUM

PER_3

P

1

2

R3310K

12

R360R0

12

R390R0 NC

C282.2uF

C292.2uF

12

JP4JP

1

2

3J3

JUM

PER_3

P

12

34

56

78

910

J2

5X2_HEADER

12JP3JP

C3

330nF

C304.7uF

1

2

3

J4

JUM

PER_3

P

1 2

L5BEAD

1 2 3 4

J6CON4

1 2 3 4

J8CON4

1 2 3 4

J9CON4

1 2 3 4

J10CON4

1 I/O1

2 GND

3 I/O2 4I/O2

5VBUS

6I/O1U8

USBLC6-2

TP1

SPI1_Clock

1VBUS2D-3D+4ID5GND

J7

Mini TypeB

C218pF

C3118pF

1 VIN

2GND

3 VINH

4BYPA

SS

5OUT

U4

LDS3985XX

1 2

34

Y18.000MHz

R10R0

R130R0

TP2

TP3

TP4

12

R140R0

1CLK

5GND

3 VDD

4 DATA

2L/R

U7

MP34DB01

1CLK

5GND

3 VDD

4 DATA

2L/R

U9

MP34DB01

3 CLK

4 DATA

2L/R

1VDD

5GND

U10

MP34DT01

3 CLK

4 DATA

2L/R

1VDD

5GND

U11

MP34DT01

I2S_BICK

I2S_LRCK

I2S_DAT_12

I2S_DAT_34 STM32_I2S_DATA34

STM32_I2S_DATA12

STM32_I2S_BICK

STM32_I2S_LRCK

VCC_USB

VCC_USBA_VDD

UC_VDD

UC_OSC_IN

UC_OSC_OUT

UC_VDD

UC_VDD

SCL

SDA

USBDM

USBDP

NRST

I2S_DAT_12I2S_DAT_34

I2S_DAT_56

I2S_BICKI2S_LRCK

SCL

3.3V

RESET

STBY

SDA

MCLK

MUTE FAIL

RESET

A_VDD

UC_VDD

UC_VDD

VCC_USB UC_VDDUC_VDD

USB_DISC UC_VDD

MIC_DATA12

UC_VDD

MIC_VDD

MIC_DATA12

MIC_CK

MIC_VDD

MIC_DATA12

MIC_CK

LED1

MIC_CK

LED2

UC_VDD

LED1

LED2

LED3

MIC_VDD

UC_VDD UC_VDD

UC_VDD

STBY

MUTE

FAIL

UC_VDD

12.288_CK

MIC_VDD

MIC_VDD

12.288_CK

LED3

VSS_CAP

VSS_CAP

VSS_CAP

12.288_CK

STM32_I2S_MCLK

JTMS

STM32_I2S_BICK

STM32_I2S_LRCK

NRST

JTCK

2.5V

3.3VUC_VDD

MIC_VDD

MIC_DATA12

MIC_CK

MIC_VDD

MIC_DATA12

MIC_CK

STM32_I2S_LRCK

STM32_I2S_BICK

STM32_I2S_DATA12

STM32_I2S_MCLK

MCO

USB_DISC

USBDM

USBDP

JTMS

MCO

JTCK

JRST

STM32_I2S_LRCK

STM32_I2S_BICK

STM32_I2S_DATA34

UC_OSC_IN

UC_OSC_OUT

JRST

MIC1CK

MIC1LR

MIC2CK

MIC2LR

MIC_VDD

MIC_VDD

MIC1LRMIC1CK

MIC_DATA12

MIC_DATA12

MIC_VDD

MIC_VDD

MIC_DATA12

MIC2LRMIC2CK

AN4041 Layout

Doc ID 022706 Rev 2 11/14

Appendix B Layout

Figure 8. Board layout - top view

Figure 9. Board layout - bottom view

Ordering information AN4041

12/14 Doc ID 022706 Rev 2

Appendix C Ordering information

The APWLink+ demonstration boards mentioned in this document are available on www.st.com referenced by the ordering codes listed below.

Table 3. Ordering information for demonstration boards

Order code Board description

STEVAL-MKI116V1 MEMS microphone demonstration board based on the MP34DB01 and STM32F107RC

STEVAL-MKI117V1 MEMS microphone demonstration board based on the MP34DT01 and STM32F107RC

STEVAL-MKI117V2 MEMS microphone demonstration board based on the MP45DT02 and STM32F107RC

AN4041 Revision history

Doc ID 022706 Rev 2 13/14

4 Revision history

Table 4. Document revision history

Date Revision Changes

30-Jan-2012 1 Initial release

06-Sep-2012 2Updated maximum supply voltage for MP34DT01 in Table 1Added Appendix C: Ordering information

AN4041

14/14 Doc ID 022706 Rev 2

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 TWO AUTHORIZED ST REPRESENTATIVES, 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.

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