Contents
- 1 micro:bit Micro Bit
- 2 XMOS libraries etc,
- 3 Conclusion 25Apr2023 on headphone output
- 4 Update on the ICS-52000 mics
- 5 Conclusion 01Mar2023 on microphone
- 6 Background
- 7 XMOS X3 (XCORE®.AI)
- 8 Digital MEMS mics
- 9 «Smart» MEMS mics
- 10 WM8904
- 11 Analogue MEMS mics
- 12 Units
- 13 PMDWay
- 14 Earphone amplifier
- 15 Forums
micro:bit Micro Bit
This is swearing in the church. But the micro:bit v2. has a Knowles (analog interface) SPU0410LR5H-QB-7 MEMS microphone with a built-in LED indicator on board! Plus two very nice processors (Nordic nRF52833 – 64 MHz 32-bit ARM Cortex-M4 microcontroller. The other is preprogrammed for the USB-to-processor comms). Why not let it pick up the mic and send it over to my board? The micro:bit environments look very nice, maybe even fun to work with? The analog mic interface is not ideal if I were to interface it myself, but as long as it’s mounted on a ready board, fine.
XMOS libraries etc,
19May2023. lib_i2s
is all I need! (update 02Jul2023, maybe not..) (Also see 141:[XMOS libraries] and 219:[XMOS libraries])
- The ICS-52000 microphone board sent over data as
TDM
(Time Division Multiplexed) 2’s complement data. This is supported in the XMOSlib_i2s
(GitHub). I have used 2.2.0 but have 3.0 installed as well. Both are written in xC. I still use xTIMEcomposer. But the newest at GitHub is 5.0.0, entirely written i assembler. However, the include of<xclib.h>
seems still to exist. I have it with xTIMEcomposer as well. 5.0.0 hasDEPENDENT_MODULES = lib_xassert(>=4.0.0) and lib_logging(>=3.0.0)
. May I use 5.0.0?
See XCore Exchange point 3. Yes, I may! - For the Pimoroni PIM44 audio DAC also may also use
lib_i2s
- Update 02Jul2023:
lib_i2s
(when using TDM at least) seems to need an external clock. See XCore Exchange point 4. Update 27Jul2023: I have written a driver in xC that has a 1.024 MHz SCK and 16000 Hz sampling rate at 32 bits * 2. rather than using an external PLL which is needed for 1.024 MHz, I have I have tabulated SCK’s duty cycle to be within spec, but on the average still end up with 1.024 MHz - Update 08Sep2023. With the
Conclusion 25Apr2023 on headphone output
Update on the ICS-52000 mics
Update 03Dec2024: For the next mic I should consider Adafruit 3421.
Update 24Aug2023. I wrote the I2S driver myself. I tested the notWired NW-AUD-ICS52000 containing four ICS-52000 (here and here) mics. But I seem to have problems with them, reading only noise (the NW-AUD-ICS52000 have by 08Sep2023 been proven not to work). See here:
- See miniDSP forum point 1
- See TDK InvenSense Forum point 1
I then found the single-mic ICS-52000 development board SDK InvenSense EV_ICS-52000-FX, see AN-000001 (here and here) and bought them from Mouser (their number 410-EV_ICS-52000-FX) (and back order for 1.24? from Farnell (3861388)). With it comes a Molex 52610-1071 10 pos zif female connector. I didn’t have a board to solder this to, but..
..after half a day of searching and several mails I ended up with «Dual Row 1.00mm Pitch 20-Pin to Dual Row 2.54mm Pitch Adapter» from Chip Quik (chipquik, where I also bought them) as their part number DR100DR254P20 in the PROTO-ADVANTAGE series (here, where in the referenced AN0003.pdf I find DR100D254P20 but not DR100DR254P20). This board is 17.78 mm x 25.40 mm, if divide by 2.54 we get exactly 7 x 10. This means that if the 2×10 plug connector is positioned on the centre of the board (which it looks like on the photo, and it sounds logical) then the alignment to any bottom 1/10″ □ board would be 2,5 units on each side short side. See my illustration. This means that I need the least 5 holes between the DIP sockets on the board I connect to, see here. Update: since this board comes unassembled, with loose sockets, there are quite large margins as to where to solder the connectors). Digi-Key, Elfa Distrelec and others had them too, but with 4 weeks lead time and no photo. Since Chip Quik doesn’t seem to have a data sheet for it, a photo is a must. Update: thank you, Anders for soldering the 1 mm and the other contacts for me!
Conclusion 01Mar2023 on microphone
Update 08Sep2023: Observe that the NW-AUD-ICS52000 I have now proven that it does not work. It sends over noise only. See below.
I went for the NW-AUD-ICS52000 (not very smart, see above) board from notWired.co, which contains four MEMS mics ICS-52000 from TDK InvenSense. See more about these below
* Both the mics and the board are NR/ND not recommended for new designs, but I have no problem with that
* My xCore-200 Explorer board also has been obsoleted (My single-board boards and why notes) (But I’m going to port Beep-BRRR to it)
* As well as the xC programming language (xC is C plus x)
* By going for the ICS-52000 I will then not have to relate to the XMOS lib_mic_array
* But in the future I may use the X3 processor (lib_mic_array) version with the lib_xcore
(C plus lib_xcore black-boxes xC), though
* Or even the RISC-V based X4 processor XMOS xcore RISC-V
* Maybe in the future I could use a complete chip that takes microphone input and has earphone output. Search for «WM8904» here. Maybe if MikroE updated their MIKROE-506? Or if Adafruit made one?
* I may even be rather obsoleted myself. But even if I am retired, I am not tired! Because I am really looking forwards to porting my Beep-BRRR (below) to the xCore-200 Explorer board and the ICS-52000 mics
Background
I have an application that uses XCORE and a mic (*). See My Beep-BRRR notes and My Beep-BRRR notes (some log & movies). Since one of my two XMOS mic array boards went dead (here, and I haven’t tried heating it in the oven, which my friend the expert suggested as a last resort. I fear it, bottom parts may fall off..) then I am going to port my SW onto the xCORE-200 dev board (which I have some of, here), and I am in need of a mic. I only need one.
This note is just a scratchpad. If you should find it useful – good!
(*) Not the 1966 mic on the photo, from my beloved Standard SR-250 tape deck. I was 16 at that time. One of these days I’m going to repair it. I have an extra spare, but both are in pieces now. But I do have the service manual.
- Not sure if «electret» microphone is a MEMS component. Update: they are not.
- «Electret» is an electrostatic microphone (electrostatic and magnet) (Wikipedia) and is kind of the opposite of a speaker. The foil electret type was invented in 1961, so my mic on the photo could be one of that kind)
- A MEMS (Microelectromechanical systems) microphone has microscopic parts forming a micro-sensor. The term is rather new, but even this technology is from the sixties (Wikipedia)
- Not sure what the usage criteria for I2S and PDM might be. Is PDM faster? Update: should be
- I could of course use an analogue mic with an AD board
- There is something called a «Smart MEMS» microphone, which would contain some more stuff, perhaps. «Smart» isn’t that smart a term to give anything a precise contents. More below.
XMOS X3 (XCORE®.AI)
This board has a connector to up to two PDM microphones with MIC_CLK
(on port P1G, via 100R), MIC_DATA
(on port P1F, via 100R) and power (settable to 1V8 or 3V3) and ground. The HW description says that this is meant to connect to XMOS microphone boards. The connector has 6 pins and is not the same as the «TDK Analog or Digital MEMS Microphone on a flexible PCB» connection on the SmartSound One board (below) which has 8 pins. There also is an MCLK
and an I2S_MCLK
which comes from the processor pin L1 as APLLOUT
and goes to a TLV320AIC3254 Ultra Low Power Stereo Audio Codec with Embedded miniDSP (here). The main thing for me is that there is no external PLL. However, I see that that the XMOS AI processor has an app PLL HW, like several other microcontrollers these days, like the RP2040 used in Raspberry Pi Pico board (here). Of course the system clock PLL has always been there, since the transputer and maybe even earlier.
But would I need a low-jitter PLL? I assume not, since I am going to use one microphone only and don’t need to know accurate phase differences.
About my Mic-array board: To control the MEMS mics’ clocks a Cirrus Logic CS2100-CP (here) delivers a low-jitter 24.576 MHz clock, the MIC_CLK
. Configuring its Fractional-N phase lock loop PLL is done over I2C. Then there is a NC7NZ34 buffer (here). From the HW description: «The CS2100generates a low-jitter output signal that is distributed to the xCORE- 200 device (Tile1 & MCLK) and DAC (MIC-CLK) (DAC-MCLK
)«. However, there also is an alternative external input EXT_MCLK
, by moving by soldering a zero Ohm resistor. MIC_CLK
is buffered over a FXL4TD245 (here). The return data is buffered back into the processor over a SN74AVC8T245 (here).
See questions at Forums.
Digital MEMS mics
SPH0645LM4H (I2S)
- The Knowles SPW2430HR5H-B mic datasheet is here.
Adafruit 3421
Update: Should I need more mics and I don’t have any more or fail to get hold of the SDK InvenSense EV_ICS-52000-FX, I should perhaps study this mic first.
Adafruit I2S MEMS Microphone Breakout: https://www.adafruit.com/product/3421
This board also at ElfaDistrelec here.
MP34DT01-M (PDM)
- The STMicroelectronics MP34DT01-MC mic datasheet is here
Adafruit 3492
Adafruit PDM MEMS Microphone Breakout: https://www.adafruit.com/product/3492
Adafruit 4346
Adafruit PDM Microphone Breakout with JST SH Connector: https://www.adafruit.com/product/4346
SPH0690LM4H-1 (PDM)
- The Knowles SPH0690LM4H-1 mic datasheet is here
This microphone may be used with the XMOS lib_mic_array
.
In a thesis
IM69D130 (PDM)
- The Infineon IM69D130 mic datasheet is here
This microphone may be used with the XMOS lib_mic_array
.
On the XMOS mic array board v2
I use(d) this in my prototype of my Beep-BRRR, see 219:[xCORE microphone array]. This is the second version of that board. This board is now obsoleted. The first version used the AKU441:
AKU441 (PDM)
- The Akustica AKU441 mic datasheet is here. Obsoleted
This microphone may be used with the XMOS lib_mic_array
.
-
- Sensitivity -26dBFS ±1dB
- 63dB SNR
- VDD 1.62V to 3.6V
On the XMOS mic array board v1
This was used on the first version of the XMOS mic array board. See «v2» chapter (above).
ICS-52000 (TDM)
- The TDK ICS-52000 (from TDK InvenSense) mic system datasheet is from here. Status not recommended for new designs (NR/ND) (T5848 recommended)). (Update: in the SDK InvenSense AN-000001 data sheet (above) there are three boards, for these mics: INMP441, ICS-43432 and «my» ICS-52000. All obseleted I think. But according to this page, ICS-43434 is in production on Sep2023). This is very interesting:
«The complete ICS-52000 solution consists of a MEMS sensor, signal conditioning, an analog-to-digital converter, decimation and antialiasing filters, power management, and an industry standard 24- bit TDM interface. …connect directly to digital processors, such as DSPs and microcontrollers, without the need for an audio codec in the system.»
Excerpts from the datasheet: «TDM. The data word format is 2’s complement, MSB-first. The ICS-52000 has an internal digital bandpass filter. A high-pass filter to remove unwanted dc and very low frequency components. The analog-to-digital converter in the ICS-52000 is a single-bit, high order, sigma-delta (Σ-Δ). It does require a good quality low-pass decimation filter to eliminate the high frequency noise. The pass band of the filter extends to 0.417 × fS and, in that band, has only 0.04 dB of ripple. The high frequency cutoff of −3 dB occurs at 0.5 × fS.»
- Sensitivity: -26 ±1dB @ 94dB SPL
- S/N 65dB
- VDD 1.62 V ~ 3.63 V
SDK InvenSense AN-000001 (EV_ICS-52000-FX)
When I bought these I discovered that the software driver I had written for the NW-AUD-ICS52000 worked just out of the box. I can now hear myself in the headset with data coming from the ICS-52000. This means that the NW-AUD-ICS52000 I have proven not to work. It sends over noise only. See this discussed in Update on the ICS-52000 mics (above). I also summed this up on Stack Exchange, Signal Processing (below), point 2.
notWired NW-AUD-ICS52000
Update 08Sep2023: Observe that the NW-AUD-ICS52000 I have now proven that it does not work. It sends over noise only.
- Information is here (update 24Aug2023 dead url?)
Since ICS-52000 is not recommended for new designs (NR/ND), this probably isn’t either. But it certainly is available.
Also available from https://www.cdiweb.com Component Distributors Inc. (CDI). I bought 5 there. Postage == component
«Smart» MEMS mics
See Stack Exchange, Signal Processing question 1 for more depth on this one. Read it first! Most PDM-type mics would probably contain a Σ‑Δ modulator. However, an increased order sigma-delta ADC adds 6 more dB increase in SNR (Signal Noise Ratio) for each order; a 5th order will offer 33 dB/octave (doubling of frequency) of SNR improvement. I found a formula on Wikipedia, but it’s related to oversampling (Delta-sigma modulation (Oversampling)). «When the sampling frequency is doubled, the signal-to-quantization-noise ratio is improved by 6N + 3 dB for a N-order ΔΣ modulator.» So if we don’t increase the frequency but the order (I don’t know if this is a correct assumption), we’d get an improved SNR/octave of 6*5 + 3 = 33 dB. Order (1, 2, 3, 4, 5) then have (9, 15, 21, 27 and 33) dB/octave of SNR. So these mics will be much quieter. Thanks to Dan Boschen at DSPrelated.com, for inspiring me on the above. I hope I’ve got some of it right.
Even if using a 5th order sigma-delta is smart enough, it’s probably the fact that since audio sensing is combined with «cutting-edge motion detection» (TDK InvenSense) (etc.) it may make «smart» an ok term here.
The company TDK InvenSense has a range of these: T5828, T5837, T5838, T5848 (here). The three first would contain a Σ‑Δ modulator. According to the ST AN4990 application note (here) page 15 this
The digital filter performs the filtering (averaging) of the 1-bit data stream generated from the sigma-delta modulator. The filter output is a data word with higher resolution (usually 12 – 24 bits) but reduced data rate (decimation). The digital filter function consists in removing out-off band frequency components (quantization noise, unwanted signals…) and reducing the data rate according to the useful bandwidth (decimation).
See questions at Forums.
T5828 (SoundWire)
- The TDK InvenSense T5828 Σ‑Δ modulator mic datasheet is here
This one uses the MIPI Alliance SoundWire® interface. I have not found breakout board with any of these chips. Neither from notWired.co. But there are evaluation boards (EVB) for them.
T5837 (PDM)
- The TDK InvenSense T5837 Σ‑Δ modulator mic datasheet is here.
I think this one is the one that would be most interesting for me. The EVB description is here. There also is a larger evaluation platform board «SmartSound One», here. But as mentioned above, that board’s mic interface has 8 pins, not 6 pins as does the XMOS interface.
T5838 (PDM)
- The TDK InvenSense T5838 Σ‑Δ modulator mic datasheet is here
T5848 (I2S)
- The TDK InvenSense T5848 mic datasheet is here
Recommended for TDK ICS-52000.
WM8904
Search for «WM8904» in this document.
Analogue MEMS mics
SPW2430
- The Knowles SPW2430 mic datasheet is here.
Adafruit 2716
Adafruit Silicon MEMS Microphone Breakout: https://www.adafruit.com/product/2716
SPQ0410HR5H-B
- The Knowles SPQ1410HR5H-B mic datasheet is here. 94 dB. Obsoleted according to Mouser.
MikroElektronika
Mic click board: https://www.mikroe.com/blog/mic-click-omnidirectional-silicon-microphone
ICS-40180
- The TDK InvenSense ICS-40180 mic datasheet is here
Sparkfun
SparkFun Analog MEMS Microphone Breakout – ICS-40180: https://www.sparkfun.com/products/18011
SPH8878LR5H-1
- The Knowles SPH8878LR5H-1 mic datasheet is here
Sparkfun
SparkFun Analog MEMS Microphone Breakout – SPH8878LR5H-1. With 60x amplification: https://www.sparkfun.com/products/19389
Units
M5STACK
Microphone Unit (LM393)
- I found no datasheet of this mic
This is probably most meant to be a sound level detection unit. Nice, but not for me.
https://shop.m5stack.com/products/microphone-unit-lm393
SNR 40 dB, 5V, max4466 preamp and LM393 analog comparator. The output from the latter is the so-called «DIGITAL» connection: ANALOG and «DIGITAL» connect. HY2.0-4P cable interface, 2X LEGO™ compatible holes. See diagram here
PMDWay
This Australian company has several microphone breakout boards, see https://pmdway.com/collections/microphone-breakout-board.
Earphone amplifier
Overview of amplifier classes is here. I guess that class-D (Wikipedia) and class-H are relevant here. (Headset, headphone audio) I am after something with digital input.
Searching around I find some breakout boards, but it looks like some of them miss any circuit diagram.
The headphone amplifier in the XMOS mic array board is a DAC from Cirrus Logic called CS43L21. It takes audio data over I2S and control over I2C. Its data sheet is here. It seems still to be available, but I cannot find any breakout board with it. There is a hugely expensive evaluation board CDB43L21. Not relevant now.
Pimoroni PIM544 audio DAC
I ended up buying this board. The Pimoroni Pico Audio Pack PIM544 (here) contains a PCM5100A stereo DAC (datasheet) and a PAM8908JER stereo headphone amp (PAM8901/8908) (datasheet). It has 3.5 mm stereo audio jack outputs for line and headphone. The circuit diagram is here. I don’t know why the DAC is named «PCM..» (since there is not any pulse coded modulation as such) when it uses I2S. It needs
:
1- Left-justified serial data SD or or DIN or I2S_DATA
2 – Word select WS, stereo left/right «clock» or I2S_LRCK
3 – Bit clock or BCK or I2S_BCK
4 – MUTE (optional – but used in the description for the Raspberry Pi Pico which it is «designed for»)
Not chosen
There also is the Adafruit 3006 board with MAX98357A D-class output, but am uncertain about using it for headphones, since it needs a specified coil inductance. Therefore I queried at Stack Exchange, Electrical Engineering point 1 (below). There also are answers there (should be ok!) I think I’ll go for the Adafruit board, since the chip also seems to be not EOL. The Analog Devices page for MAX98357A and B is here. A design note is here.
Analog Devices has a headphone amplifier page here → there. They list a myriad of headphone amplifiers: MAX97003, MAX97220C, MAX97220D, MAX97220E, MAX97220A, MAX97220B, MAX97200, MAX9820, MAX13330, MAX13331, MAX9792, MAX9791, MAX9728, MAX9724A, MAX9724B, MAX9724C, MAX9723 (I2C for gain), MAX9725, MAX9850 (I2S for DAC and I2C for control), MAX9722B, MAX4409, MAX9720, MAX4411, MAX4298, MAX9722A. Many of them have a class-H amplifier type for the headphone outputs, with a separate class-D for the speakers only.
The soon to reach EOL (end of life) WM8731 audio codec from Wolfson Microelectronics (here, now owned by Cirrus Logic) has microphone inputs and a charge pump based headset output. Data sheet here. It’s used in the obsoleted Sparkfun Arduino Codec Shield (here) and MikroElektronica Audio Codec Board – PROTO MIKROE-506 (here).
Cirrus Logic suggests (here) to replace WM8731 with WM8904 (here). Both do digital mics and have built-in sigma-delta converter plus decimation filters etc. But I have found no board with this. I could hope for an upgraded board from MikroE for this in the future? Or maybe Adafruit?
Forums
Also see 219:[Forums]
miniDSP forum
- https://www.minidsp.com/forum/mchstreamer/16370-mchstreamer-tdm-input-from-ics-52000-mems-mics#44371 – by alexmstahl in late 2019. Question about only hearing noise from ICS-52000 (as I do per 14Aug2023). See StackExchange, Signal Processing (below), point 2
XCore Exchange
- XMOS microphone boards or alternative? – started by me 13Feb2023. Answer provided
- Using a PLL for mic clock(s) – started by me 23Feb2023. Response from fabriceo, with 141:[41] as a very important input (I/O timings for xCORE200 by XMOS 2017)
- lib_i2s TDM – which version for xTIMEcomposer – started by me 19May2023. Answer provided
- lib_i2s I2S/TDM clocked from _internal_ source? – started by me 02Jul2023. Answer provided
- Finding number of zeros from MSB and down to first non-zero – started by me 24Oct2023. Answer provided
- Headset noise when printing – started by me 25Oct2023
- Sporadic «crosstalk» from I2C into TDM mic input when ports and SW on the same slice or connector – started by me 26Feb2024
- dsp_math_multiply_sat explanation – started by me 07May2024. Also see Power Spectrum
Stack Exchange, Signal Processing
- Smart MEMS microphones – started by me 13Feb2023 (response!)
- Noise only from TDM input from ICS-52000 MEMS mics on board NotWired NW-AUD-ICS52000 – started by me 14Aug2023. See miniDSP forum (above) point 1 and TDK InvenSense Forum point 1 (below). Answered by me 21Sep2023:»It turned out that the NotWired NW-AUD-ICS52000 boards did not work (with my SW drivers, I tested several). They only produced noise.When I received the alternative single-mic boards EV_ICS-52000-FX (here) my SW drivers, which had been unmodified since the last tests, worked right out of the box, so to say.Another interesting thing is that I was able to pull in two audio channels at 32 kHz (16 kHz each, SCK 1.024 MHz) as well as a single channel at 16 kHz (SCK 512 kHz). The ICS-52000 data sheet (here) would say «The frequency of SCK will depend on the number of microphones in the system. The SCK frequency should be n × 32 × fS, where n is a power of two (2, 4, 8, or 16) equal to or greater than the number of ICS-52000s on the bus. Table 8 shows the recommended SCK frequency for a chain of ICS-52000 microphones.» Table 8 also lists 1 channel, which I guess the description also should have done, since 2exp0=1.All of this also worked with somewhat asymmetrical SCK (but within SCK duty cycle specs) , but with the sum giving 100% accurate 32 or 16 kHz. Therefore I did not have to use an external PLL for this (XMOS X2 core) design.«
- Strange spectra of different volume sines – started by me 09Jan2024. See movies mp4 or mov
- Filter away INT_MIN when doing DSP since -INT_MIN is undefined(?) – started by me 27Jan2024 (as «»Safe» macro for absolute value?»)
- Relative energy vs. magnitude of spectrum – started by me 11Jul2024
Stack Exchange, Electrical Engineering
- D-class audio amplifier like MAX98357A output for headset – started by me 10Apr2023 (also see point 1 diyAudio (below))
TDK InvenSense Forum
They also call this «Developers Corner».
- Noise only from TDM input from ICS-52000mics on board NotWired NW-AUD-ICS5200 – started by me 14Aug2023. See miniDSP forum (above) point 1 and See StackExchange, Signal Processing (above), point 2
diyAudio
I am not certain about how serious this forum is, as observed from the kind of ads that turn up there. Ads that not at all reflect the kind of urls I ever visit. But I did find quite good technical discussions there. Maybe something for the admins to reconsider?
- D-class audio amplifier like MAX98357A output for headset – started by me 11Apr2023 (also see point 1 above)
Adafruit forum
In FORUMS | INDEX SUPPORTED | PRODUCTS & PROJECTS | OTHER PRODUCTS FROM ADAFRUIT
- I2C SCL line rise time differs from SDA – Posted by me 19Jun2023. The diagram is here