Go Down

Topic: Arduino Due Serial RX limitations? (Read 87 times) previous topic - next topic


I am using the Programming Port on the Due as a Serial device.
I'd like to use the USB Host for another task.

I get decent throughput while transmitting, but while receiving things get pretty rough.
Looking through some code for various parts, including the 16u2 and HardwareSerial.h, I believe this to be a limitation of the RX buffer, 128 bytes.

Am I correct in assuming that given this limitation and the USB poll rate of 1 second it is only possible to receive 128 bytes or serial data per second on the Due through the programming port?

I'd really like to transfer to the device at bossac speeds as seen when programming the device, but I assume this is some sort of special mode. I am seeing stuff like 20kb, 85 blocks, in a few seconds.

Any thoughts on this are welcome, I would be awesomely pleased to find out I was doing something incorrectly.


Hardware serial is hardware. You can select up to 115200 baud, which is about 11kByte/sec. You can't go faster than that. You may notice that it's faster to program on native USB, which doesn't have that limitation.

There's no USB polling. I don't know where that idea comes from

You should never let the buffer fill. This means your sketch should look at Serial.available() and do at least some Serial.read() on a regular schedule, like 1000 times per second. If you do delay(1000) somewhere in your sketch then yes, you will be limited to 128 bytes per second.
GoForSmoke: "What GShield? You never mentioned a shield."


The USB polling is from my code.
I can see now how that makes no sense in context.

Long story short, you were right I wasn't checking often enough. Too much work in the loop. I think this will work now.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131