- Sun Nov 21, 2021 11:46 am
#229782
I'm having trouble reading samples as fast as I need to. I'm aware that analogRead is not optimized for speed in any way, more so for convenience. When I time analogRead on my Artemis Nano I get approximately 80 microseconds per read, or a frequency around 12 kHz. My goal is to be able to read two channels at 44 kHz each (audio sampling for FFT). I can live with lower frequencies and a single channel if needed, but the documentation for the Artemis and Apollo3 core seem to say this shouldn't be any problem.
On the ATMEGA chips I was pretty good at sorting through the datasheets to access low level behavior, but these Apollo3 cores are so much more complex and I'm drowning...
I searched the forms here and found the post "High Speed Analog Acquisition" but there's so much more going on in that example than just an analogRead replacement that I can't follow what's going on (timers, sleep, DMA, etc). And the example seems specific to the Artemis Red Board and doesn't work on my Artemis Nano . I'm making the assumptions that it's the board difference that breaks it, but regardless of whether that's true or not the program does not run on my board and attempts at debugging are getting me nowhere.
SO...
Does anyone have an example of an analogRead replacement that works faster? Eventually I'd like to figure out how to sync it with a timer and possibly use DMA, but for now I just want to tackle one issue at a time.
Help?
On the ATMEGA chips I was pretty good at sorting through the datasheets to access low level behavior, but these Apollo3 cores are so much more complex and I'm drowning...
I searched the forms here and found the post "High Speed Analog Acquisition" but there's so much more going on in that example than just an analogRead replacement that I can't follow what's going on (timers, sleep, DMA, etc). And the example seems specific to the Artemis Red Board and doesn't work on my Artemis Nano . I'm making the assumptions that it's the board difference that breaks it, but regardless of whether that's true or not the program does not run on my board and attempts at debugging are getting me nowhere.
SO...
Does anyone have an example of an analogRead replacement that works faster? Eventually I'd like to figure out how to sync it with a timer and possibly use DMA, but for now I just want to tackle one issue at a time.
Help?