E-Series I2S Sound Bus Help

Hello everyone,

I am developing firmware for a product which uses a microphone on the I2S sound bus.
I need to use the microphone to get sound readings (preferably in decibels) to monitor any noise pollution the product may sense.

Here is the Datasheet for the particular microphone.

Does anyone have a library or some code to read from a microphone on the bus?

To my knowledge, no one has implemented I2S on Gen 2 devices. I’ve thought about it, and have the hardware to test it, but never got around to doing it. It will require messing around with STM32 hardware registers probably using the STM32 Standard Peripheral Library, which is available to regular user firmware.

There is a small but non-zero change getting it to work will require a Device OS modification. I’m guessing probably not, but there is a possibility.

There have been a number of people who have expressed an interest so I’m sure if you figure out how to do it, it would be appreciated!

2 Likes

Thanks for the quick reply. I'd love to have I2S working.

I'm not very familiar with STM32 hardware registers or the STM32 Standard Peripheral Library.

I could try to get started, but I doubt I'd get very far. The low-level Particle and STM32 stuff is very mind boggling for me. I would certainly appreciate a working I2S implementation on Gen 2 devices, and I am sure there are many people who would as well.

What I'm trying to say is that anyone who gets I2S working would be absolutely legendary.

@rickkas7

Am I wrong to assume that the I2S on the e-series would work through SPI1?

I don’t know much about SPI but I’ll read up on it this week.

From what I’ve read in the STM datasheet and the Particle Docs, I2S uses the same pins as SPI1.

The table on page 118 looks very interesting.

While it shares the same pins the actual functional block controlling the interface is not the same for I2S or SPI(1).
On the STM32F2 pins can have multiple purposes and depending on intended purpose the respective GPIOs get hooked up to the respective functional block (implicitly “detaching” them from any other).
Due to the lack of high level API you have to do that (re)assignment the low level STM32 way.

Do you have any tips on how to actually do that? @rickkas7 has mentioned that low-level stuff would be required as well, but I'm not sure how to do it.

Nope, I haven’t.
I’ve looked into the STM docu for I2S and got scared off :wink:
There are some sample implementations to be found for STM32F4 & F7 but I never investigated how portable they’d be for F2

Dang it. Hopefully Particle addresses this in the future.