Hello, I’m trying to figure out what is the fastest way to transfer either being straight native USB or USB to uart bridge on arduino? Can someone please help me out to figure this out?
Joseph
Hello, I’m trying to figure out what is the fastest way to transfer either being straight native USB or USB to uart bridge on arduino? Can someone please help me out to figure this out?
Joseph
SD cards don't speak USB or UART. I would mount the SD card on the PC and copy directly.
@jremington I understand and that I modified my question.
Did you forget to mention other relevant parts of your setup?
For those who might be confused by this thread, the OP edited the original question, which was
I’m trying to figure out what is the fastest way to transfer a 1 MB file from PC to an SD card
@jremington At this moment. Not even sure which one yet. There are so many out there like the arduino zero board or the adafruit metro boards even pic boards. I have them all. My question is more of the native usb or usb to uart which one if faster when transferring data or files of any kind from the pc to whatever board.
In theorie USB2 can do 480Mb/s which is way faster than what a UART can do.
You have an Arduino Zero so you can test it with reasonable ease. Just pump a 10GB file over and see how long it takes in both scenarios.
Be aware that a PC is usually not a real time system; it might be doing other things so can't always transfer an other chunk of data immediately so the theoretical throughput will not be reached.
You will encounter problems at the Arduino side and that is the processing of the received data. E.g. your original post mentioned an SD card and writing to that SD card takes time which will have an effect on the throughput. Not waiting long enough will result in data loss so you need a protocol to tell the sender to stop sending while the writing to SD is in progress.
thank you @sterretje I also waswondering would running it at 115200 the highest it can go or can a arduino board like the zero Samd21 can use a light buad rate then that or just keeping it at that rate?
I'm not sure if I understand.
FYI
Native USB does not have a baudrate. For a number of boards you have to set it (as the core requires it) but you can use any baudrate in e.g. serial monitor.
That's not the way to go. @jremington 's answer to your original question became invalid when you edited out the SD part. In the future, update the info in new posts instead. Thanks for your cooperation.
There's a baud setting when burning a bootloader that is ridiculously high, 900000?
So @josephchrzempiec just try a higher baudrate in your sketch and PC, and if it doesn't work turn it down.
Thank you @ledsyn
@ledsyn the question is not about sd cards. I added that because I don’t know what I’m using yet. They really wasn’t a part of this and I should have never put that in there.
The question was about native usb or usb to uart. What would be the fastest.
I can appreciate that. It however screws up for the users who try to help. It's better to add a correction in a new reply.
I don't think any of the traditional Arduinos do "High Speed" (480Mbps) USB2; they all top out at "Full Speed" (12Mbps.)
I've clocked a SAMD21 at more than 6Mbps doing "Serial.write" over the native USB, so I think it's pretty safe to say that native USB is going to be faster than having an actual serial port involved. (I don't expect the Serial implementation to be very optimized.)
OTOH, with a relatively slow and low-memory system like most Arduinos, it can be hard to "dispose" of any data you get at that sort of speed. I have no faith at all that an Arduino can write to an SD card as fast as it can read data from USB, for example (most SD interfaces being limited by SPI's 1-bit width and usually relatively low clock rate...)
How can you possibly be so confused about what you wrote?
Before you changed the question, it was
I’m trying to figure out what is the fastest way to transfer a 1 MB file from PC to an SD card
Anyone can verify that by clicking on the "edit pencil", upper right of post #1.
If that is what you really want to do, the bottleneck may not be PC to Arduino serial communications.
What about USB to SPI bridge, that could be faster than either
@ledsyn I understand that. My fault there.
Thank you @westfw
Honestly @jim-p I don’t know I never pushed either as fast as they can go. That why is I’m asking first. What would be better.
Thank you all for the help and understanding. Sorry if I was off on my questions. I wasn’t trying to use an sd card. I wasn’t sure how I put that in there.
My question was what is faster using native usb or usb to uart adapter. @westfw help d me to understand it better then I thought. Again thank you all for helping me.
Joseph