This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB CDC - Protocol incomprehension

Hello,

I'm using USB CDC of LDC1000 EVM, I want to read the firmware version, set the Timer_Interval and start the data polling and streaming to host. I'm using Firmware version 0.3.0.0. I have read the topic right below, that explained the protocol but I can't get the correct returned values.

http://e2e.ti.com/support/data_converters/inductive-sensing/f/938/p/292002/1044458.aspx#1044458


I tried two ways, first I used a terminal (COM4, 115200, 8bit data, no parity, 1bit stop, no flow control).

For example, when I type the command "09", the command doesn't correspond and only the first recognized number is sent to the EVM. In this case, it's 9 but I don't get firmware version, it increments the value of RP Max ( When I pressed 32 times I got 0xF to 0x1F  ).
The "8" command decrements the value of RP Min ( 0x3F to 0x20 ).
The "7" returns 0x0, 0x1, 0x2 or 0x3, I don't know what it is.
The "6" increments by 10ms the sampling frequency ( by default the speed is 1000ms ).
The "5" decrements by 10ms the sampling frequency.
The "4" stops steaming.
The "3" starts steaming.
The "2" I'm not sure but I think it returns the value of the Inductance.
The "1" returns the value of Proximity Data in Hex.

The second way I tried is to do a C program to send the command on the serial COM and read the returned values, but I get the same results.

I'm missing something about the protocol or I don't understand it, could you explain me, and how can I set directly the timer interval instead of sending "x" times the command to get 19Khz sampling.

Kind regards,


Antoine.

  • Hi Antoine,

    Press '?' in the terminal.  This will allow you to see the menu for the limited-function ASCII protocol.  Keep in mind that none of the protocols are terminated by return, null, or newline.

    The legacy protocol supported is prefixed by an ASCII zero '0'.  For instance, '09'.  You have to write both into the buffer to get a response.  The response is an echo of 32-bytes.  You would get the reading at the eight offset of the buffer (zero-based counting).  In the firmware 0.3.0.0, it is line 149-152 of host_legacy.c.

    I take it you understand C?  In that case, the firmware is included in the GUI distribution under subfolder "/firmware."  If you understand embedded C it should be relatively straightforward to see how all three protocols are supported:

    1. legacy (documented in the E2E FAQ), found in host_legacy.c

    2. ASCII menu, found in host_interface.c

    3. byte-based protocol, found in host_interface.c

    We are awaiting approval to roll documentation for all three protocols into the EVM Guide soon.

    Thanks,

  • Hi Charles,

    Thank you very much for your quick reply, I followed your instructions and I took a look at the three protocols, I fully understand ant it's working fine now.