I'm working with an ATmega32U4 board similar to the Leonardo. I want to transfer a large amount of data from the host computer to the board. Right now I'm using the Serial uart to transfer 32 byte blocks with an explicit handshake to avoid overflow, but it is very slow. I have the baud rate set at the maximum 115200. Is there a way to get the Serial uart to run closer to the maximum USB speed? Is there another approach I should try? One alternative is to develop a USB device class for my application, but that appears quite complex and I'm hoping to avoid it.
The serial communicaton via the usb is with a software serial port on the Leonardo.
Perhaps you could use the hardware serial port (pin 0, 1 on Leonardo, Serial1 in sketch) with a usb-to-ttl-serial adapter.
Creating an USB device should be possible, but I don't know how to do that.
I've seen examples that a handshake was slower than the influence of the baudrate. How do you use a handshake, with polling or in interrupt ?
On both sides with interrupts ?
Perhaps you should do a throughput test with and without the handshake.
There are alternatives. Like packages with addresses; checksums with resend, and so on.
What is the large amount of data for ?
Could you compress the data ?
I see many possibilities, but it depends on what kind of data you have and what you want to achieve.