Is there a simple (iminal) example of DMA with two analog inputs?
Thank you
i was unable to construct my system from the available documentation. i want to output a short waveform while simultaneously reading two channels of analog input, at a clock rate as fast as the simple can run.
Is there a simple (iminal) example of DMA with two analog inputs?
Thank you
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputAnalogStereo adcs1(A2,A3); //xy=331,263.2 //<<<< change Analog ports if needed
AudioOutputUSB usb1; //xy=501,263.2
AudioInputUSB usb2; //xy=629.4,261.8
AudioOutputAnalog dac1; //xy=794.2,255.2
AudioConnection patchCord1(adcs1, 0, usb1, 0);
AudioConnection patchCord2(adcs1, 1, usb1, 1);
AudioConnection patchCord3(usb2, 0, dac1, 0);
// GUItool: end automatically generated code
void setup() {
// put your setup code here, to run once:
AudioMemory (16);
}
void loop() {
// put your main code here, to run repeatedly:
}
Not sure if that meets the requirements of the OP since he wanted "at a clock rate as fast as the simple can run" while the audio library limits everything to the poor sample rate of 44.1kS/s. With thoughtfully hand crafted code, one should be able to obtain up to 8 times higher rates.
Nevertheless, I find it amazing how little user code you need to get a functioning audio system.
The coder should remain in control of every single bit, though, instead of assembling black boxes.
You asked for a simple example.And so, c++ and drag and drop interfaces, might not be a good match to that purpose.