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
  • Hi Sagar

    It sounds odd that the terminal application would be the bottle neck in this case. How often are you sending 240 bytes of ADC data?

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

    We have done some testing to verify what kind of speeds you can expect when using the CDC class. 

    In Windows we reached around 1700 kbps, while on Linux we reached around 2580 kbps. 

    Best regards
    Torbjørn

  • Hi,

    Thank you for your reply

    I am sending it very 200 microsecond.

    If Serial terminal is not recommended, then do you suggest any tool/ any way for data validating.

    Thanks & regards

    Sagar 

  • Hi Sagar

    Any chance you could try the same using Putty and see if the problem is still there?
    Putty is a very popular terminal application, and should hopefully show clearly if the problem is with Tera Term or somewhere else. 

    An alternativ to using a terminal is to use a serial library for Python, or some other programming language, and make a custom script or application to process the serial data. 

    Best regards
    Torbjørn

  • Hi,

    I have already tried with putty, minicom, docklet and also serial library everywhere same issue.

    Is there any limitation with the NRF52840 operating at USB full speed?

    Thanks and regards

    Sagar

  • 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

Reply
  • 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

Children
No Data
Related