Closed ladyada closed 2 years ago
This would be used for lots of things beyond audio though--sampling any signal from the ADC, like a piezo, light sensor, load cell, etc.
Yah - i think its the mirror. technically its not just for Audio, and i dont think we'd do WAV translation? but maybe we would?
@jepler this might be a good one to pick up soonish (since ulab would be a good pairint)
I'm interested in this too. Here's some previous forums discussions where this has come up:
I'm not sure if it's related but I've noticed some demand for performant circular buffers discussed in CircularBuffer equivalent in CircuitPython?.
It would be great to be able to choose the 14bit ADC mode on the nRF52840. I'm curious if that gives better results than doing it in software. It's certainly more efficient in terms of CPU cycles.
I would like to add more control over the ADC on all ports, such as specifying oversampling, averaging (if available), maybe even differential mode, etc.
The native nRF52840 ADC accuracy is 12 bits. You can set it to 14 bits, but that just shifts the result over if oversampling is not enabled. But with oversampling, you can get 14 real bits.
I've just put some graphs of the nRF52840's 12 bit mode in action in CircuitPython 5.2.0 in Changing ADC to over-sampling mode for higher resolution?.
Added some performance data on a few different ways to read and sometimes store samples in https://forums.adafruit.com/viewtopic.php?f=60&t=164758 - nothing better than 21-21kHz on a CLUE.
Please review https://github.com/latkinso42/circuitpython branch adcdma as a possible solution or possible solution to this issue. Thanks!
for some applications, we want to grab a chunk of samples from ADC at 'fast' (16KHz!) fixed periods. lets think of a way we can request an array of 16-bit values that will be popped off the ADC pin at samplerate
EDIT: Implemented as
analogbufio
forraspberrypi
-- Thanks @latkinso42!! I will open separate issues to implementanalogbufio
on each other port and close this general one.