Validating the data over USB

Hi ,

Device :-      nrf52840

USB class :- CDC ACM

We are sending the  ADC data (240 bytes at a time) to Host computer over USB (Full speed) and checking the received data in serial terminal (Tera Term),but we are missing the data because the tera term is not able to handle the full speed USB data. So is there any tool / how to get the data without any data loss.

and what is the maximum throughput we can achieve in USB full speed ?

Thanks & regards

Sagar

Parents Reply Children
  • Hi Sagar

    Saagar said:
    I am sending it very 200 microsecond.

    So basically you are trying to send 240 bytes 5000 times a second, equaling a total data rate of 1.2MB/sec, or 9.6Mbps?

    This is definitely more than the nRF52840 can handle. As I said earlier we have been able to reach around 1700kbps and 2580bkps respectively on Windows and Linux. 

    It is important to remember that the quoted 12Mbps data rate of USB full speed is just the physical bus data rate. The application datarate will always be lower than this, since there is various forms of data overhead (address information, header bytes, crc codes etc) and you are not allowed to use the bus 100% of the time. 

    Best regards
    Torbjørn

  • Hi,

    Let me very clear, There is already a delay ( reading the ADC data via SPI (operating at 2Mbps) filling the tx buffer(240 bytes) ) then sending it through USB. again I am adding delay manually of 200 microseconds. So total data I am sending is 14 MB/ Min.

    Thanks & regards

    Sagar

  • Hi Sagar

    Thanks for the clarification. 

    Are you able to share your code with me, showing how you receive the data and pass it over to the USB stack?

    Are you making sure to check the return values of all the USB functions, in order to detect if there could be any errors returned by any of them?

    How do you see that the data is incorrect? 
    Are you missing a byte here and there, or entire blocks of data?

    Have you verified the incoming data (using the debugger for instance) to make sure that the problem happens after it is uploaded to the USB stack, and not before?

    Best regards
    Torbjørn

Related