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: LDC100 AUdrino Noisy Proximity Readings 0x21 0x22 ( But readings smooth not noisy when LDC100 is resoldered to LDC1000 evm evaluation USB Stick)

Part Number: LDC1000

Dear TI Community

I have just spent 3 days solid interfacing the LDC1000 to audrino it works but the proximity meausrments are noisy

I have now evaluated the LDC100 EVM using the TI GUI. it works well and I will embed it into a vibration sensing application using a Bentley Nevada proximity probe.

The next step is to interface the LCD1000 with my own microcontroller.

I started of with a pic 18f252 all the connections were correct used a logic analyser to check all spi packets looked correct. but the LDC1000 never replied with any data.

Next i tried an audrino nanao as I had one in the lab. A user called "Pelonomi Moila" Posted on this form a full code and pdf on how to interface the audrino to the ldc100.

I wired it all up and hurray it works 1000-32768 count printed to serial port from audrino this is the in the proximity register from ldc1000 as i hold metal closer and further to targert.

So it works but there is a big but. I am getting lots of noises the signal is jumping and jittering very noisy if I set the metal target distance so the proximity register reads 10,000 then the reading is very jumpy

10,000 next reading 9400, next 10,254, etc etc.

So I spent hours unsoldering the ldc1000 and put it back on the ldc1000 evm module again and magivally the reading then goes perfectly stable Rp is now 10,000 10,001 9,999 very smooth now.

Then soldered it back to the audrino again and the data goes all jumpy noisy unstable jumping 800 to 1000 bits between each reading when the metakl target is at rest.

The example audrino program I uses does not have an external clock on the LDCLK Pin. And it does not setup the 0x04 and 0x05 register

I do not want to read the frequency registers i only want to read the proximity registers.

Is this correct ? if I only want to read the proximity registers and not the frequency registers then I do not need to add an external 8MHz clock to the LDCLK pin and dont need to setup register 0x04 and 0x05 ??

Or do you have to connect up an external 8MHX clock and set up the the LDC config 0x05 and Clock config 0x05 registers to get the proximity reading to work smoothly without all the noise im getting? Is the noise because I dont have an 8MHz crystal and havent set up regiser 0x04 and 0x05

My proximity reading works but its soo noisy i cant work with it ive come a long way but the noise is unbareable the signal is awfully noisy i have tried tuning rp min rp max comparator theshold high and low nothing gets rid of the noise.

i have put 100nf capacitos accross the 5v analog rail to gnd

across the 3.3v I/o rail to gnd

nothing in the world gets rid of the noise as soon as i unsolder it all and put it back on the LDC100 evm usb stick proximity readings are all perfectly smooth no noise only jumping +/- 3 bits in 32768 but on audrino reading is jumping +/- 800 bits allover random noise.

Audrino code posted below works well reads proximity 100-37768 but very very noisy reading from proximity register adress ox21LSB 0x22 MSB

I have come to far to give up now how can i get ris of the noise is it because i havent connected 8Mhz clock and setup register 0x04 and 0x05 even though i dont care about freq register only proximity register i need

Thanks for looking please give advice

CODE::::::

*

Author: Pelonomi Moiloa
24 June 2014

Code to read proximity data from proximity registers

Note: Sensor frequency, LDC configuration and CLK configuration register setup is
only neccessary when needing to read frequency data

*/

#include "SPI.h" // include arduino SPI library

const int CSB = 10; // chip select bit for Arduino Uno


void setup()
{
unsigned int data = 0;
Serial.begin(9600);
// start SPI library/ activate BUS
SPI.begin();

pinMode(CSB, OUTPUT);
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0); // CPOL = 0 and CPH = 0 mode 3 also works
SPI.setClockDivider(SPI_CLOCK_DIV4); // set SCLK @ 4MHz, LDC1000 max is 4MHz DIV2 also works

//Start initialisation of LDC1000
// set power mode to idle to configure stuff
digitalWrite(CSB, LOW);
SPI.transfer(0x0B);
SPI.transfer(0x00);
digitalWrite(CSB, HIGH);
delay(100);

// Set RpMax
digitalWrite(CSB, LOW);
SPI.transfer(0x01);
SPI.transfer(0x0E);
digitalWrite(CSB, HIGH);
delay(100);
// Set RpMin
digitalWrite(CSB, LOW);
SPI.transfer(0x02);
SPI.transfer(0x3B);
digitalWrite(CSB, HIGH);
delay(100);
// disable all interrupt modes
digitalWrite(CSB, LOW);
SPI.transfer(0x0A);
SPI.transfer(0x00);
digitalWrite(CSB, HIGH);
// set thresh HiLSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x06);
SPI.transfer(0x50);
digitalWrite(CSB, HIGH);
delay(100);
// set thresh HiMSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x07);
SPI.transfer(0x14);
digitalWrite(CSB, HIGH);
delay(100);
// set thresh LoLSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x08);
SPI.transfer(0xC0);
digitalWrite(CSB, HIGH);
delay(100);
// set thresh LoMSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x09);
SPI.transfer(0x12);
digitalWrite(CSB, HIGH);
delay(100);
// set power mode to active mode
digitalWrite(CSB, LOW);
SPI.transfer(0x0B);
SPI.transfer(0x01);
digitalWrite(CSB, HIGH);
delay(100);
// end of Initiailsation

//Check to see if values were written to registers correctly
/*
// Read Rpmax
digitalWrite(CSB, LOW);
SPI.transfer(0x81);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
delay(500);
// Read Rpmin
digitalWrite(CSB, LOW);
SPI.transfer(0x82);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
// Read thresh HiLSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x86);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
delay(500);
// Read thresh HiMSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x87);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
delay(500);
// Read thresh LoLSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x88);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
delay(500);
// Read thresh LoMSB value
digitalWrite(CSB, LOW);
SPI.transfer(0x89);
data = SPI.transfer(0x00);
Serial.println(data);
digitalWrite(CSB, HIGH);
delay(500);
*/
}

void loop()
{
unsigned int val = 0;
unsigned int dataLSB = 0;
unsigned int dataMSB = 0;
unsigned int proximitydata = 0;

// Read proximity data LSB register
digitalWrite(CSB, LOW);
SPI.transfer(0xA1); // 0x80 + 0x21
dataLSB = SPI.transfer(0x00);
digitalWrite(CSB, HIGH);
delay(100);

// Read proximity data MSB register
digitalWrite(CSB, LOW);
SPI.transfer(0xA2); // 0x80 + 0x22
dataMSB = SPI.transfer(0x00);
digitalWrite(CSB, HIGH);
delay(100);

proximitydata = ((unsigned int)dataMSB << 8) | (dataLSB);// combine two registers to form 16bit resolution proximity data
Serial.println(proximitydata);
}

  • Hello Matthew,
    the LDC1000 firmware source code is installed together with the GUI; I assume you already reviewed to source code and compared it to your code.

    To ensure that you get the best noise floor on this device, please ensure that
    - RPMIN/RPMAX are set correctly according to the datasheet
    - CFB capacitor is chosen correctly
    - the maximum response time setting is chosen that supports your sample rate requirements

    Please also review the power supply of your board; if you have significantly more noise on your Arduino board than on the LDC board, then you will experience a higher output code noise floor.
  • Dear Ben

    Firstly thanks so much for replying

    I spent allot of time on this and can not get rid of the noise. Proximity register  0x21 and 0x22 is jumping +/- 600 bits every reading when the metal target is at a steady fixed distance from the target coil

    Sorry for the double thread.

    Please can you answer this question Relating to LDClk and configuration register 0x04 and 0x05 ?I only want to read proximity registers 0x21 0x22 so I take it I do not need to read frequency register if my application is just axial distance sensing proximity data?

    Does this mean I do not have to set up an 8MHz square wave for LDCK external clock and I do not need to set up register 0x04 LDC config and 0x05 Clock configuration to read proximity register only

    In simpler words will proximity reading work without noise if you do not set up LDClk 8Mhz and configure 0x04 and 0x05 and are are theses 3 things only needed if you are trying to read and use the frequency registers?

    The next problem is I would love to see the firmware C code that is on the EVMLCD1000 MSP40 MCU

    If I just copy the same register configurations i could get my audrino to read the proximity data smoothly without noise

    I can not find the source code for the LDC100EVM.

    The GUI is installed on my desktop to "C:\Program Files\Texas Instruments LDC1000 EVM GUI\ldc1000.exe"

    In the folder C:\Program Files\Texas Instruments LDC100 EVM

    there are many folders including usb drivers labview interface folders etc

    But I cant find the source code for the LDC1000 evm MSP40 mcu If i could find this C code it would tell me all I needed to know.

    I shall get an oscilloscope on the 3.3v and 5v Rails of the Audrino but I have already put 100nF caps right across these rails to GND and the noise is still there.

    I think the noise could be the register setup I dont know if a need to set up 0x04 and 0x05 or not if i only need proximity data.

    Please can you provide me a link to the LDC1000EVM MSP40 Mcu C code firmware then I can make the code in my audrino do the same SPI packets and hopefully get rid of the noise

    Is the LDCclk and 0x04 and 0x05 purley hardware for the frequency register and cant effect the Proximity register 0x21 and 0x22

    many thanks Ben for taking the time to help

    Much appreciated

    Kind regards

    Matthew

  • Hello Matthew,

    One other consideration on your noise - the LDC1000 response is non-linear, where the code output with the target closer will have much higher 'code' noise, but when converted to Rp the noise is actually lower.

    Regards,

    ChrisO

  • Hello Matthew,
    the firmware source code is in the firmware sub-directory (eg: C:\Program Files (x86)\Texas Instruments LDC1000 EVM GUI\Firmware\LDC1000_F5528_V3_Public )