Since thursday, I’ve been working on the microphone. We have decided to use this micro, in a first time, just for capture the sound intensity and force the player to scream during to scream during a spell.
In the future, we’ll maybe use it to make some voice recognition, using the same algorithm employed for the motion recognition.
But so far, I still get problem to receive the data from the microphone. We are linked to the processor thanks 2 pins that provide a possible using of I2S, with I2K CLK and I2S SD.
I have configured the different registers to not only to have a correct clock but also to precise all the I2S characteristics choosen, as described in the documentation.
Despite this, when I read the SPI status register, I don’t see the “receive buffer not empty” flag enabled, what means that any data was received. So, I think this a clock problem because the data transfer is dictated by the clock. I wanted to see with a analogical analyser the clock but the pin is too small and it’s too risky. Then, I’ve decided to just check the clock pin with a direct reading of the pin but for the moment, I see a fixed value. I’ve enabled the SPI2 clock, which is available on the same pin, but it still doesn’t work.
I must have overlooked something but I will try and fix this issue quickly.
If anyone has a idea that may help me, there will be most welcome 🙂
See you !
To observe the pin with oscilloscope: solder a small wire to it, and connect the oscilloscope to the wire.
For the pin:
Check the pin configuration by reading the register with debugger:
-Correct alternate function
-Correct push/pull(not open drain) cobfiguration
Is that just a typo error that you speak of I2S and then SPI registers?
Otherwise, which one is the master? generates the clock?
For the observation of the clock and data on the pin but thanks for your advices Alyx 🙂
Felix, it wasn’t a typo, I use the SPI register because the SPI and I2S are on the same pin and to enable the I2S for example, I have to change a SPI configuration register.
The master is the processor and it generates the clocks.
Yesterday, we finally succeed in making the microphone and I will post about this today 😀