I am testing the USB CDC example project and cannot get it to send 64 bytes of data although this equals the max packet size and should be most efficient. Up to 63 bytes can be sent without problems but 64 bytes does not work for some reason.
Any hints? Thanks in advance.
Well, I think it is possible to send as many 64 byte packets as I like and when I am done just send a zero-length packet as required by the usb standard to make sure that the host acknowledges the last packets, i.e. I do a USBUART_PutData() with length parameter =0.
Actually I am not sure how efficient the Cypress implementation is, but "fixing the bug" as they say in the defect report would probably make the PSoC send a zero-length packet after each 64 byte backet and this would decrease throughput. By sending 64 byte packets one after the other and just checking if USB can accept more data inbetween I have reached about 590 KBytes per second which is not very bad for USB CDC. This is probably the best one can achieve without completely rewriting the driver...
To achieve max speed for USB CDC Full Speed you should:
1. Put max possible bytes in one packet = 64 bytes for CDC
2. Try to send as many packets as possible in a 1ms frame: up to 19 packets is possible but this is only for a free USB bus, in practice you will not reach 19, maybe 16 or so
3. Of course the speed also depends on the USB hardware and the driver.
See this post for more info: http://www.microchip.com/forums/m450163-print.aspx
For a PIC32 they get about 800 KBytes/s. In some Cypress appnote I saw that only 80 KBytes/s were possible for CDC but this is probably not correct.