I've been working on an application that uses the AKU340 acoustic sensor to get readings on ambient noise (and eventually send it to a VPS).
Reading the sensor's datasheet did not give me any information about the highest sampling rate it can achieve, but the sample acoustic sensor code sets it to 22.05kHz which should be enough if I were to run an FFT to analyze the signal's frequency components.
I've been reading the sensor values via FreeRTOS soft-timer callback functions, but the highest sampling frequency I'm able to get is 1kHz and that's not enough to get a good spectrum analysis for sound.
Are there hardware timers I can use? Is there some kind of buffer on the sensor I can read multiple data points from? What would be the most efficient way of doing this?
Thanks in advance,
Solved! Go to Solution.
I've been trying to use the Hardware timers described in https://developer.bosch.com/web/xdk/timer-and-countern. But reading the RMS values from the sensor from inside the interrupt function doesn't seem to work. It stops the kit from booting up...
I'm out of ideas
I recommend to read https://developer.bosch.com/web/xdk/acoustic and https://developer.bosch.com/web/xdk/analog-to-digital-converter
Basically high-performing use cases for the ADC (and not exclusive to the XDK hardware) include chaining the ADC, DMA (memory transfer controller) and HW-Timers together with the interrupt engine.
The main issue with the XDK Accoustic Sensor is that the HW connection between AKU340 and the microcontroller is not optimal and due to this, the signal levels coming to the XDK are quite limited in time and signal characteristics.
the experience here is quite mixed with some frequency limitations (f<1kHz) and nowhere the posibilities the AKU340 will give you with the right connections
Thank you for replying.
So do you think connecting an external acoustic sensor to the ADC pins and getting readings during HW-Timer interrupts would work? Also, how do I access/configure the DMA controller on the XDK? Is there even such a feature on this kit? If so, is there documentation I can take a look at? I have never worked with DMA before so any directions would be appreciated.
basically the code would look the same as with the AKU340 ADC, just with the pins reconfigured to go to the extension bus.