2025-02-08 06:34 PM
Hello. For a couple months now, I have been trying to get the microphone on the STM32F407-g Discovery board to work. It started out as a minor part of a self-guided course, but now it's turned into a personal quest. The farthest I've gotten so far is receiving random noise (totally random: an equal rate of 1s and 0s) into an audio buffer. Now I'm at the point where I've wired up a logic analyzer and am seeing exactly that noise coming from the microphone itself.
After two malfunctioning examples of the STM32F407, I ordered a third and was extra careful to only handle it with an anti-static wrist strap clipped to the bottom USB port. I loaded the program and got the same result:
The rising and falling edges of the data signal do closely follow the clock signal:
Furthermore, all three signals disappear if I remove the call to `BSP_AUDIO_IN_Record(&audioBuffer, 128)` from my main.c. So it looks to me that this really is the signals going into and coming back from the audio sensor.
Granted, it's Pulse Density Modulation, so under some circumstances it should look like this, but I'm testing this in a quiet environment.
Also, I am a dude-off-the-street novice; I could definitely be breaking these boards or messing up the audio sensing in some way which I just can't know to avoid. But, based on what I know about this technology, this evidence takes the problem out of the realm of software: it looks to me like something is wrong with the hardware, and it's wrong right out of the box. Find my program attached, for you to check.
I'd like to be wrong about this.
-Aidan
2025-02-09 04:11 PM
When "quiet", the microphone outputs mid-level, i.e. roughly the same number of zeros and ones.
You have to use a software filter to convert PDM to PCM. There is probably a related example in Cube, search there or at the internet.
JW