USB Host speed
I am new of this forum. I am using PIC32MX460F512L to develop an application interfacing a flash 2.0 USB pen.
I have to save very quicky in the attached USB 2.0 flash drive image files wich size is 331776 bytes (324 KBytes).
Starting from microchip example I am using MSD libraries and I am able to write the file in 2 seconds.
But I wuold expect to have better performance.
Looking at the USB interrupt and the manual I see that every millisecond PIC32 is able to send up to 12000 bits.
In my example I have bulk transfer. Every transfer with 64 bytes.
The media sector size is 512 bytes.
What I see is that every time a sector is written on the flash key, the driver performs these operations:
1. Write CBW (31 bytes) and wait answer (this tooks 1 millisecond using very low bit times)
2. Read/Write the sector (512 bytes) in blocks of 64 bytes (this is performed in another millisecond)
3. Read CSW (13 bytes) and wait answer (this tooks another millisecond using very low bit times)
So I have 3 milliseconds for reading/writing 512 bytes but I am using very little of the available band.
With this implementation I think is not possible going quicker, even if the manual declare 1.22MB/s speed for bulk tranfer.
Is there a way to make things better?
What is the max speed I could expect in this case?
How can I increase the performaces?
Thanks in advance.