I'd like to build a prototype using the nrf9160DK that samples audio from a microphone and plays it back. Given that the dev board has Arduino compatible headers, I'm assuming the easiest thing to do is get a shield like this one?
If so, I'm looking for any sample code that shows how best to interact with an Arduino shield using the nrf SDK. Obviously a microphone example would be preferred, but I'm looking fo any arduinio shield examples as they will likely show the way.
Actually, doing further research indicates that that previous shield was a bit over kill. A much simpler microphone (there are many) just produces an analog out that can go into one of the Arduino pins. If I use that approach, I just need the nrf9160 code example to read the analog pin. It'll be my job to stash it away.
You could use the PDM peripheral as well, as there's many digital microphones that use this bus as well.
In order to use the SAADC peripheral to perform ad conversions in nrf connect sdk, there's a process that needs to be performed first:
1. Add the SAADC peripheral to the non-secure region:
After this line: https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/samples/nrf9160/secure_boot/src/main.c#L336
you must append:
Then build and flash this onto the device.
2a. Adding the SAADC to the project requires a nrf9160_pca10090.overlay file to hold:
status = "ok";
2b. Then you need to add the ADC driver itself to the project in "prj.conf":
Now, you can add the functions needed for using the ADC in your example. I made an example here to show what's needed:
Thanks Hakon, we'll check this out! Much appreciated