Pascal Barbary

FRDM-k66f usb CDC device HS

Discussion created by Pascal Barbary on May 17, 2018
Latest reply on Aug 10, 2018 by Hui_Ma

In a project with an 8 channel 12-bit simultaneous sampling ADC, the sampling rate is 100kHz.
So every 10µs the MCU needs to forward the data + a time difference, via USB to a host PC running Matlab.

 

In its raw form and comma separated, 26 bytes. In a timeframe of 5µs -> 5,2MB/s.
In ASCII formatted and comma separated, 56 bytes. In a time frame of 5µs -> 11,2MB/s.

The time frame is only an assumption, the other 5µs is to accommodate the other functions that need to be done.

 

The CDC class from the example can follow until an interval of 200µs. But after 16 transfers it stalls for 240 counts!
How come? Please advice.

 

Following the print screen at the receiving end in Matlab, with an interval of 200µs, 100µs and 10µs.
An example with only the bare necessities added to simulate the USB communication.

 

The number at the end is a count 0->255!

Time interval 200µs.

Time interval 100µs.

Time interval 10µs.

Outcomes