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.

LDC1000: Trouble adjusting sample rate in LabVIEW

Part Number: LDC1000

Hi,

First off, I'd like to point out an error in the LabView sample code. This flag needs to be changed in order for streaming to work. The 0x02 and 0x04 are the only two flags I could get it to work with.

The second error: This is the original diagram in LDC1000_setsamplerate.vi. The "Actual Sampling Rate (Hz)" is incorrect, and does not give the true sampling rate. 

Below is the version I modified, as per the MATLAB sample code, and am now getting the right sample rate back. On the left hand side, I have added the trailing 0's that were included in the MATLAB code, but not in LabView. It does not appear to have made in changes to the behavior of the program, but I left it for good measure.

Now to my problem: I have been unable to set the sample rate of my LDC1000EVM to less than approximately 3,800Hz. I can set it to 1Hz, which is what I'm after, in the "LDC1000 EVM GUI", but not in LabView. As you can see below, with the modified code, the response code and actual sample rate match. There are two random characters at the end of the response, which I suspect has to do with the sample code not using termination characters whilst reading. 

I have tried setting the sample rate anywhere between 4kHz and 30kHz, and have had no problems streaming. When I set it below ~3.8kHz, however, the application terminates within a few seconds. Sometimes it will plot 1-2 samples before terminating, and sometimes none. When I rerun the application and try and write to the LDC1000EVM, I get an unusal response. I can only stream again after removing and reinserting the LDC1000EVM in the USB port. 


I have considered sampling at 5kHz and using LabView to extract everything 5,000th sample, but I may concerned that it will use a lot of processing power and memory, which I product I intend to integrate it into may not have, so any help in resolving this issue would be would be much appreciated. 

Thank you.

  • Hi Ali,
    Thanks for the labview feedback! Also we've got your question. We will get back to you as soon as we can.

    Best Regards,
    Bala Ravi
  • Hi Ali,
    Are you using the following EVM for your test: www.ti.com/.../snoc028 On our product page, we also have an older version available which is not recommended and we do not support it anymore. I will test this in lab and get back to you, meanwhile can you confirm that you're using the latest version of the GUI.

    Best Regards,
    Bala Ravi
  • Hi Bala,

    Sorry, I have accidentally marked your answer as having answered my question

    To clarify, I am integrating this sensor into a larger system powered by LabView, so LabView related files are what I'm interested in. I am not sure if this was obvious from your response.

    To be sure, I have uninstalled everything LDC1000 related and downloaded the following from the LDC1000 page.

    • Sensing Solutions EVM GUI Tool v1.9.4 (Rev. E)
      • This is the same version you linked me to in your previous email. I have replaced it with the one downloaded through your link, just in case. 
      • The GUI appears to have been made using Python.
      • I have checked the default install directory (C:\ti\Sensing Solutions EVM GUI-1.9.4) and am unable to find any LabView files.
    • LDC1000 Firmware Library for the MSP430
      • None of the firmware files here are suitable for the MSP430 chip on the LDC1000 board (Physically marked as MSP430F5528)
      • Discarded

    • LDC1000 EVM Software GUI (not recommended)
      • This has installed two programs - Sensing Solutions EVM GUI Tool v1.9.3 and LDC1000 EVM GUI 1.0.4.1
      • Sensing Solutions EVM GUI Tool v1.9.3 is an older version of the GUI you sent me the link to - I have ignored this
      • I believe LDC1000 EVM GUI 1.0.4.1 is the GUI you alluded to that is no longer supported. This appears to have been made using LabView (Visual cues). It has an option to change the sample rate. My desired sample rate of 1Hz works when set through here.
      • This software also comes with LDC1000 Firmware 0x300 (Default directory is C:\Program Files (x86)\Texas Instruments LDC1000 EVM GUI\Firmware\LDC1000_F5528_V3_Public). I have queried my LDC1000EVM board and it claims to have this version installed. Comparing expected vs actual responses to commands sent through a terminal affirms this.
      A "LabView" folder can be found in the default install directory (C:\Program Files (x86)\Texas Instruments LDC1000 EVM GUI\LabView). This contains the only LabView source files I can find published by TI on the LDC1000EVM product page and forum.
      • The LabView project contained within is not the same as that used to make LDC1000 EVM GUI 1.0.4.1.
      • Readme file comments: "This folder contains LABVIEW Vis to read/write registers and to stream data from LDC1000EVM. Please see "LDC1000 Demo.vi" for typical usage of these Vis"
      • 'LDC1000 Demo.vi' is what I have used to build on.

    I believe, therefore, despite they fact the LabView files were supplied with the old, no longer supported GUI, that I have the most up to date (and only) LabView files that have ever been published TI, found here: http://www.ti.com/lit/zip/snac058

    As I am able to do exactly what I want in LDC1000 EVM GUI 1.0.4.1, which appears to have been made using LabView, would it be possible to get the source files for it, and see how it has been done there?

    EDIT - Looking a little more closely at the firmware and LabView code, it appears that the "08" command is being sent to the MSP430, where it is then processed by the functions in "host_legacy.c". I am confused about what this function actually does, because I am reading and seeing conflicting information... I'll explain. Let's use 5,000Hz for this example.

        case Command_Timer_Interval:
        	data_word = (uint16_t) hexchar2dec(&pBuf[2],4);
    		data_word = (24e+6)/data_word;
    		taskInterval = data_word/SCHEDULER_DIV;
    		pBuf[8] = (data_word >> 8) & 0xFF;
    		pBuf[9] = data_word & 0xFF;
    		host_response = 1;
    		break;

    In LabView, there is a numerical input box labelled "Sample Frequency (Hz)". The value put in there is converted to hex and prefixed with "08". The hex value for 5,000 is 0x1388 Therefore, the output command from Labview is 0x08138800. Command_Timer_Interval is defined as 08 in the header, so the code above should run. SCHEDULER_DIV is defined as 240 elsewhere. taskInterval, therefore, equals 20. This is then saved with the task, and defines the number of ticks before it is actioned. "scheduler.c" has a comment defining 1 tick = 100us. This will result in a read every 2000us = 0.002 seconds = 500Hz, not 5,000. If for arguments sake, I have am off by a factor of 10 because I missed a division or multiplication somewhere, then to have a frequency of 1Hz, my tick value, and therefore, taskInterval, would need to be 10,000. Working backwards:

    taskInterval = data_word/SCHEDULER_DIV;

    Therefore, data_word = 10,000*240 = 2,400,000. 

    This is not possible since data_word is defined as a 16-bit integer (Max value of 65,535)

    Then in this thread, https://e2e.ti.com/support/sensors/f/1023/t/295036, however, under question 37: "send data length = 4 numeric ASCII chars.  Timer clock period. (e.g. "1234" = 24MHz/1234 = 19.4kHz )".

    Then the MATLAB code provided with the old GUI has this formula: 

    d=fread(sport,c);
    T=256*d(9)+d(10);
    Fset=24e6/T;

    I would be very appreciative if I could take a look at the LabView files that were used to make the LDC1000 EVM GUI 1.0.4.1 and see how 1Hz sampling was done there.

    Thanks again

  • Hi Ali,
    Sorry we do not support the older version of the EVM GUI and I do not have access to the labview source code. Sorry about that.

    Best Regards,
    Bala Ravi
  • Hi Bala,

    Is there still support for the LabView demo, which is unrelated to the GUI, and is supposed to be used as a development tool?

    Kind Regards,
    Ali Goname
  • Hi Ali,
    Right now, we only support applications and hardware question related to LDC1000. Sorry I do not have the source code that you're requesting.

    Best Regards,
    Bala Ravi