I am trying to expand the capabilities of the Kinetamap (LPC4128 based) to sample a microphone. The application is shock and vibration analysis. The kinetamap already has a 3 axis accelerometer chip, I also want to be able to do a higher frequency acoustic analysis. I am planning connecting one of the SFE electret condenser mic breakout boards to one of the unused analog I/Os on the kinetamap board.
I would like to set up a regular sample interval at about 24KHz, to give 12KHz bandwidth of the measurement. I would like to store about 1024 samples into a buffer. I will write the buffer to the flash disk periodically and analyze the data later (do an FFT on the PC to see the frequency content of the captured signal). IF I can take a snapshot about every second that would be good enough.
I am not super familiar with the peripheral set of the 2148. Obviously I am getting up to speed on the datasheets, but I am hoping that someone can point me in the right direction to an example project or might have some insight on the best way to set up this measurement given the resources available on the 2148.
stevech:
Sparkfun’s GPS logger uses a '2148 with SD card flash. It’s logging GPS coordinates. But it might be a good basis.
Thanks for the post. The kinetamap firmware already takes care of logging the GPS coordianates to SD card. What I need some help with is sampling the ADC at set frequency (not just on demand).
Thanks for the sample code! As I look into the ADC peripheral closer, it looks like the LPC2148 has a burst mode option for the ADC that will automatically sample on a timer edge and generate an interrupt when the conversion is complete, so I will probably take that route. I will post the code when I have it working. I am using the WinARM GCC compiler for now, just because that is what the base Kinteamap code was started with.
jtw131:
Thanks for the sample code! As I look into the ADC peripheral closer, it looks like the LPC2148 has a burst mode option for the ADC that will automatically sample on a timer edge and generate an interrupt when the conversion is complete, so I will probably take that route. I will post the code when I have it working. I am using the WinARM GCC compiler for now, just because that is what the base Kinteamap code was started with.
The [firmware I wrote to run on the Logomatic V1 hardware included use of the burst mode but I set the ADC to run continuously. Once it finished one conversion, it started the next. The conversion rate depends on the CPU clock, ADC clock divider, and number of channels selected.](http://home.earthlink.net/~schultdw/logOmatic/LogomaticV4_0.tar.gz)
UhClem:
The [firmware I wrote to run on the Logomatic V1 hardware included use of the burst mode but I set the ADC to run continuously. Once it finished one conversion, it started the next. The conversion rate depends on the CPU clock, ADC clock divider, and number of channels selected.[/quote]
jtw131:
OK, looked at your code – so you set up an automatic conversion at a set rate, and then grab the value when an interrupt is generated and throw it in a buffer?