Arduino Forum

Products => MKR Boards => MKRZero => Topic started by: schjak on Feb 18, 2018, 05:59 pm

Title: Transfer data to PC with USB at 12Mbps
Post by: schjak on Feb 18, 2018, 05:59 pm
I need to transfer data from mkrzero to pc at a higher rate than the serial bus allows. Preferably over the USB port. Is it possible to do this at the USB transfer rate of 12Mbps?
Title: Re: Transfer data to PC with USB at 12Mbps
Post by: ballscrewbob on Feb 19, 2018, 05:15 am
Too much of an ambiguous question to answer properly.

You would need to give a LOT more detail as to the project before anyone could give an answer.
In theory anything is possible but in practice its down to things like bottlenecks.
Adding Ethernet may improve things but thats just a wild assumption until you give details.


Title: Re: Transfer data to PC with USB at 12Mbps
Post by: schjak on Feb 21, 2018, 06:29 pm
Ok, so here are the details: An MKRZero board connected with a USB cable to a computer and nothing else.

I can send data to the computer over the USB using the Serial interface - eg. Serial.write(). However I assume that is limited to 115200bps.


Is possible to send data over the USB at higher rates? For instance can I achieve the 12Mbps transfer rate which USB 2.0 supports. If yes, how?
Title: Re: Transfer data to PC with USB at 12Mbps
Post by: ballscrewbob on Feb 22, 2018, 03:50 am
Yes it is limited to the top speed of the serial and even then there are overheads.
Still wonder what it is that requires full bore speed.

And dont forget any steps in the sketch that need to occur as they all time a finite amount of time too.

12 meg is the max "Theoretical" speed BTW.
USB chipset implementation is the biggest factor along with buffers, bus speeds, cache, etc etc etc.
In practice nothing runs continual at that speed and any I know of that do are only in very short bursts.

Grab yourself a good quality USB drive and measure the transfer speeds you will see what I mean.




Title: Re: Transfer data to PC with USB at 12Mbps
Post by: gdsports on Feb 22, 2018, 04:24 am
Quote
I can send data to the computer over the USB using the Serial interface - eg. Serial.write(). However I assume that is limited to 115200bps.
Test your assumption. The microUSB port is connected to the SAMD21 native USB interface so it is not limited by UART speeds.


Title: Re: Transfer data to PC with USB at 12Mbps
Post by: schjak on Feb 22, 2018, 09:47 pm
You are right. I ran a test which showed approx 700Kbyte/s. Still only a fraction of 12Mbyte/s though.