Took a long time to get this sketch to run reliably on Giga, sometimes would not start or when running audio discontinuities at buffer change.
Sorted by delay before buf.release(); discovered when print statement put at this point. Appreciate not a real world problem but this is the sort of code one uses when building up a sketch.
Still a problem why will the Giga board only run this sketch one working and programed is there is an active serial link attached to the powering USB C cable ?
void setup() {
Serial.begin(115200);
while (!Serial) {}
pinMode(23, OUTPUT); // TP pin 23 PG13
// Resolution, sample rate, number of samples per channel, queue depth.
if (!adc.begin(AN_RESOLUTION_12, 32768, 1024, 32)) {
Serial.println("Failed to start analog acquisition!");
while (1);
}
if (!dac1.begin(AN_RESOLUTION_12, 32768 ,1024, 32)) {
Serial.println("Failed to start DAC1 !");
while (1);
}
}
void loop() {
if (adc.available()) {
TP_HI();
SampleBuffer buf = adc.read(); // Process the buffer.
dac1.write(buf);
delayMicroseconds(1);
buf.release(); //Release the buffer to return it to the pool.
Serial.println(millis()-last_millis);
last_millis = millis( );
TP_LO();
Welcome! I suggest reading the forum guidelines and then using code tags repost your code. In its existing format it is hard to follow. What is the problem, the original description does not explain what you are asking?