Fast communication between two Arduino DUE

Hi everyone,
How can I boost serial communications between 2 Arduino Due?

I have to read 12-bits analog values (voice signal) from A0, and then put them on DAC1 and send them by serial port too (to another Arduino DUE).
Everything works well when I only send them by DAC1, the output analog signal is pretty much the same, the yellow one is the output DAC:
without serialcoms.JPG
But then I send the values with serialWrite too and the sample rate decrease incredibly, it seems like something related to serial comms is delaying the process, the yellow one is the output DAC:
with serialcoms.JPG
How can I do to avoid delays using serial coms? Maybe there is a faster way to communicate two arduinos without using serial comms…

Code:


---




```
int analogValue=0;
void setupcolor=#000000[/color] {
Serial.begincolor=#000000[/color];
REG_ADC_MR = (REG_ADC_MR & 0xFFF0FFFF) [color=#434f54]
analogReadResolutioncolor=#000000[/color];
}
void loopcolor=#000000[/color] {
analogValue=analogReadcolor=#000000[/color];
analogWrite(DAC1, analogValue);
Serial.printcolor=#000000[/color];
}
```

Thanks

with serialcoms.JPG

without serialcoms.JPG

I've deleted your other cross-post @RGR4.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

While you are outputing a value thru Serial.Write(), you don't update DAC1.

A workaround would be to use a DMA, either for ADC conversions or DAC output, AND in parallel Serial.Write() to the second DUE.

An example in this thread, reply #9:
https://forum.arduino.cc/index.php?topic=645000.msg4363163#msg4363163

Furthermore, to Serial.Write() between the 2 DUEs, you can use e.g. Serial1.Write() and set the baud rate at a much higher level than 250000 bauds, several million bauds should be fine too and much faster.

A workaround would be to use a DMA, either for ADC conversions or DAC output, AND in parallel Serial.Write() to the second DUE.

But I want to send data by serial port at the same rate as I send it to DAC port. I was looking for some way of speeding up serial comms.

Furthermore, to Serial.Write() between the 2 DUEs, you can use e.g. Serial1.Write() and set the baud rate at a much higher level than 250000 bauds, several million bauds should be fine too and much faster.

It will probably work, but... Have I reached the limit with 250000 baud rate? I hope someone can help me optimizing the "software part"....