2 of 2 people found this helpful
The USBUART uses Bulk Transfer to transfer data. If one 64Byte packet is sent in a 1ms USB frame, the transfer speed will be 64000B/s which is 22MiB/6min The transfer speed 16MiB/6min is not so bad.
If you want to improve the transfer speed, please consider to use a FIFO. The original USBUART component has no FIFO implementation. So, I have created a project ti implement a FIFO to the USBUART. Please refer following my github repository.
Please note that all comments are written in Japanese.
You can increase the transfer speed by increase the periodic interrupt frequency.
That is however as far as my Japanese goes. Luckily there are translating machines!
I've done the calculation, my current speed is ±43880 B/s (and is very consistent). Do note, it doesn't matter if I use the Cypress driver or the Windows 10 driver, both give the exact same speed.
With regard to your answer:
- FIFO, I assume it means "First In First Out"?
- What kind of speed improvements could I expect? Is it a few seconds on a minute? or are we talking about big improvements?
- Using your code, will the limit still be with the buffer size, or would it be limited by e.g. the processor's speed?
Given that for the next design I can pick any chip, e.g. PSoC 63/64. Would this allow me to have much higher transfer speeds? (or better: what should I look for?)
once you upgrade to 2GB SD card, the fastest way to read data from the card will be to plug it directly into the computer slot. Even at fastest serial transfer rate ~1Mbd (approx 0.1 MB/sec), reading 6MB will take one minute, and 2GB card - forever...
1 of 1 people found this helpful
As you assumed, FIFO is "First-In First Out" or "Queue Buffer"
I have measured the transfer speed with the TXFIFO project for several periodic interrupt frequency as follows.
Interrupt Frequency (kHz) Transfer Speed (kiB/s) Time to send 16MiB (sec) 0.5 29.6 554 1.0 62.5 262 2.0 125.3 130 4.0 222.7 74 6.0 290.8 56 8.0 376.8 43 10.0 383.2 43
Please note that this measurement result including the display time of the Tera Term application.
If the interrupt frequency is increased to 10kHz, it was observed some packets are dropped due to the FIFO implementation. So I think that 6.0kHz or 8.0kHz is the reasonable frequency.
I am using a single 64Byte buffer in the implementation. If multiple buffers are used for the FIFO the transfer speed may increased more. Please do it yourself if you want.
Thank you once again! That shows quite an improvement for a relative simple implementation. I'll go and try the FIFO method myself!
Thank you for your reply odissey1.
Using a removable storage won't be possible, due to the size requirements, usability and design of the case
However, serial port communication is not a requirement at all...
I'm brainstorming about a fully new design for the PCB. A couple of things are sure: it will have a USB type-C connector (not saying it supports USB 3...) and at least 2GiB storage. The PCB will be about 3.5cm by 3cm, one side can be fully chipped, while the other side contains a small screen (27mm x 21mm) and the remaining space can be used. More than enough space I would think. It all runs on a small 3.7V 600-700mAh battery.
The device needs to record data (using a sensor connected to the USB port), and once it is full/done/battery empty, I need to read all data to the PC.
If I plug in a USB 3 USB-stick, it allows me to download files with up to 5gb/s.
What do I need to make that happen? (i.e. allot faster than now, not necessarily 5gb/s).
- do I need special hardware, or is this possible with e.g. de PSoC 63/64 chip?
can you point me in a direction to search for?
After reading https://www.electronicdesign.com/boards/how-create-and-program-usb-devices#1 I figured I need a bulk endpoint OUT and a Control endpoint IN on the device. I guess there should be native drivers that can be used for that. Leaving the question what kind of hardware I need.
I recollect a paper, where author needed 2x 12-bit ADC_SAR sustainable transfer to USB at 1Ms/sec each (4MB/sec total).using PSoC5. The solution was to use 2xSPI-to-USB external chip. PSoC5 provided 2x SPI outputs.
PS. This tutorial video about PSoC5 USB bulk transfer might be helpful