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.

Communicating with MSP430 on LDC1000EVM

Other Parts Discussed in Thread: LDC1000EVM, MSP430F5529

I would like to communicate directly with the MSP430 on the LDC1000EVM from my Windows computer. I have the Ti supplied Inductive Sensing Graphical User Interface (GUI) software working, but I would like to write my own program to communicate with the EVM.

Is the communication interface (commands to send and expected responses) documented somewhere?

  • Hi John,

    Thanks for evaluating the LDC1000 EVM.  We're working on updating the user guide to include some documentation on the firmware protocol and we're working on cleaning up some examples on interfacing for publishing.

    The LDC1000 EVM communicates to the GUI using USB CDC, which shows up as a virtual COM port.

    SPI reads and writes are passed though using a hybrid ASCII/numeric byte protocol:

    Host to EVM:

    [ Command | Register Address | Data ]

    [ 2 hex chars (ASCII) | 2 hex chars (ASCII) | hex chars (width of 2, ASCII)... ]

    EVM to Host:

    [ Command echo | Register Address echo | Data echo | Return Data ]

    [ 2 hex chars (ASCII) | 2 hex chars (ASCII) | hex chars (width of 2, ASCII)... | Numeric Byte(s) ]

    EVM to Host (Streaming of Polled Data):

    [ Rp raw data | Frequency Counter raw data ]

    [ 1024 bytes | 1024 bytes ]

    [ 16-bit Big Endian words x 512 | 16-bit Big Endian words x 512 ]

    • Data is streamed in chunks of 2048 bytes
    • The first 1024 bytes are Rp raw data, the rest are Frequency Counter raw data
    • Data is streamed Big Endian, 16-bit words
    • Samples are chronological (first word in buffer is first sample)

    Commands are as follows:

    Command_SPI_Byte_Write: "02"

    • Writes a byte to the LDC1000
    • send data length = 2 hex chars (ASCII); data: byte to write
    • return data length = 1 byte; data: numeric byte that was written

    Command_SPI_Byte_Read: "03"

    • Reads a byte from the LDC1000
    • send data length = 0
    • return data length = 1 byte; data: numeric byte that was read

    Command_Firmware_Version_Read: "09"

    • Reads the firmware version
    • send data length = 0
    • return data length = 4 bytes; data: numeric bytes, MSByte ... LSByte

    Command_Timer_Interval: "08"

    • Sets the polling interval on the microcontroller for LDC1000 data
    • send data length = 4 numeric ASCII chars.  Timer clock period. (e.g. "1234" = 24MHz/1234 = 19.4kHz ),
    • return data length = 2 bytes; data: numeric 16-bit word, little endian.  Timer A0 Capture Compare Register 0 value.
    • Warning: Intervals faster than 35kHz are unsupported

    Command_Start_Streaming: "06"

    • Starts data polling and streaming to host
    • send data length = 0
    • return data length = 0

    Command_Stop_Streaming: "07"

    • Stops data polling and streaming to host
    • send data length = 0
    • return data length = 0

    We will have a forum post announcement when the new firmware documentation and examples are available on the site.

    Thanks,

    Chuck

  • I share this C# program which reads the firmware version in case someone may find it helpful. On my laptop the EVM is on COM3, if it is on a different port on your computer you will need to adjust the program accordingly.

    using System;
    using System.IO;
    using System.IO.Ports;

    namespace TI_LDC1000EVM
    {
        class Program
        {
            static void Main(string[] args)
            {
                SerialPort evmPort = new SerialPort("COM3", 9600);
                try
                {
                    evmPort.Open();
                    evmPort.Write("09");
                    Console.WriteLine("Reading firmware version from LDC1000EVM");
                    while(evmPort.BytesToRead > 0)
                    {
                        byte b = (byte)evmPort.ReadByte();
                        Console.Write(b);
                    }
                    Console.WriteLine();
                    evmPort.Close();
                }
                catch (IOException ex)
                {
                    Console.WriteLine(ex);
                }
            }
        }
    }

  • Are there any updates on publishing a more detailed protocol?

    Or making the source code of the GUI available (the GUI seems to use Qt5 and qwt for the plot)?

    I am trying to get the board working on Linux/MAC OS X and Qt5 code would be by design easy to port.

    No problems with the serial interface as it shows up as /dev/tty.usbmodemXXX without installing any drivers.

    Now, I am trying to follow the protocol posted above and there seems to be some inconsistencies.  Maybe it is just my implementation, but here's what I found:

    The board seems to respond with 32 bytes after each command.  The first few bytes are the echo from what was sent. But the length is always 32 bytes.

    After sending the start data command (and reading 32bytes of response data) the stream of data bytes is received.  It does consist of the raw proximity data and the lower 16bit of the frequency counter data in the 512 word chunks as described.  The frequency counter are the LSB 16bits of the 24bits available in the register!  Why would we drop the most significant 8 bits?  Now, just plugging the board into my USB port and holding some metal objects to it never resulted in a value that doesn't fit into 16bits.

    Can you please publish the exact communication protocol?  And am I correct that we receive the 16 least significant bits of the frequency counter?

    Thank you for your help

  • Hi Uwe,

    A more detailed protocol will be published as an update to the EVM user guide.  This will coincide with a minor update to the GUI. 

    The data that you receive is indeed 32-bytes padded.  The offset of the return non-ASCII data is at the 9th byte (index = 8).

    There are plans to add in firmware updates to address the 24-bit issue on the frequency counter for higher inductance coils.  In the meantime this can be retrieved by reading the SPI bytes individually.

    All related threads on this forum will be updated with a response and a new sticky thread will be created for all software and firmware releases. 

    In the interim, I would suggest going the LaunchPad route for evaluation.  We have just released a MSP430 library with CCS projects with USB examples.  Please see the F5529LP:

    http://www.ti.com/litv/pdf/snaa213    Interfacing LDC1000 with the MSP430 LaunchPad

    http://www.ti.com/litv/zip/snac059    LDC1000 Firmware Library for the MSP430

    http://www.ti.com/tool/MSP-EXP430F5529LP   MSP430F5529 LaunchPad

    Thanks!

  • Hi,

    I am hoping that your updated interface software will allow us access to the raw data in a file format that will allow mathematical evaluation using SCILAB or Matlab. I would be good to just send the raw data to a file, so that we can take X data points at a give metal target distance. Would like something like have selectable number of data points, or steps of 10 up to 10,000.

    I also noticed considerable noise in the output, and was wondering if anyone has addressed a board modification to reduce this noise.

    Thanks,

    Bernard Burreson

    bernard.burreson@comcast.net

  • Hi Bernard,

    You can already do that with the GUI.  Right-click a plot and save.  You can buffer a larger number of points and look at a smaller window when post-processing the output comma-separated-values (CSV) file.

    You can also grab data directly with the MATLAB library attached to an earlier post in this thread:

    http://e2e.ti.com/support/data_converters/inductive-sensing/f/938/t/291814.aspx

    Try tweaking Rp min and Rp max to reduce the noise.  For the EVM, it should be within the 5-20 LSB range for proximity data, and even less for frequency counter data.

    Thanks,

  • I'm curious if anyone in TI's engineering team uses the Total Phase Aardvark and Beagle combo for experimentations with this sensor.  I discovered we have these in our lab.  I've never used them but a video on youtube shows them being used with an accelerometer and it shows some GUI elements like a virtual plane that moves as the sensor does and slider controls/displays.  Maybe your guys have some cool test implementations using these tools?

  • There are no plans for third-party adapter support but if the demand is high we might consider it.  You can actually develop some code on the adapters you mentioned; Total Phase has APIs for them.

    We do have some cool stuff but nothing I can reveal at the moment ;-)

  • can u make the LDC1000 EVM GUI a open source project?

    this could really help us who would like program own code to evaluate the module.

  • Hi Ni Mo,


    This is under consideration.


    Thanks,

  • Hi Charles,

    any news about the source code?

    Thanks,

    Pasquale

  • Hi!

    "Thanks for evaluating the LDC1000 EVM.  We're working on updating the user guide to include some documentation on the firmware protocol and we're working on cleaning up some examples on interfacing for publishing."


    I would like to know if the communication protocol was released yet?

    The current user guide doesn't mention anything.


    Thanks,


    Andreas

  • Hi All,
    form LDC1000 datasheet I read "Extended transactions can be used to read 16-bits of Proximity data and 24-bits of frequency data all in one SPI
    transaction by initiating a read from register 0x21.". The 24 bit issue is only a limitation of the GUI, am I correct? So If I want the 24 bit of L I have to read one byte each time via SPI so I need 16*3 clk for one L measurement. In this case could I have still 78kS/s sample rate (max sample rate from datasheet) if I bypass the GUI?
    Best regards
    Alberto
  • Hi Albi,

    The 4MHz SPI will not present a sample rate limitation. You can use the 16 sclks * 3 registers to retrieve the L conversion results. You can also use 16 sclk cycles for the first register, and 8 additional sclk cycles * 2 additional registers for less interface time.

    You will need to bypass the GUI for maximum conversion rate. The LDC1000 FW and GUI do not operate at the full conversion speed that the LDC1000 can attain with a customized sensor.

    Regards,

    ChrisO
  • Hi Chris,
    thank you very much, now it's clearer
    Best regards
    Alberto
  • Hi Alberto,

    Glad to help.

    Regards,

    ChrisO