Hi there
I am attempting to interface Arduino with the LDC1000. I have simply snapped the LDC1000 and the coil off of the LDC1000EVM and I am using those. I am using an Arduino Uno. This is my code:
#include "SPI.h" // include arduino SPI library const int CSB = 10; // chip select bit for Arduino Uno void setup() { Serial.begin(9600); // start SPI library/ activate BUS SPI.begin(); pinMode(CSB, OUTPUT); } void loop() { unsigned int val = 0; byte READ = 0x80; // MSB = 1 which is a 'read' bit byte reg = 0x04; // register address 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 // begin data transfer digitalWrite(CSB, LOW); byte data_2_send = READ + reg; SPI.transfer(data_2_send); val = SPI.transfer(0x00); // prints 8 bit decimal value between 0 and 255 found in desired register Serial.println(val); // end data transfer digitalWrite(CSB, HIGH); delay(500); }
I am able to obtain values from reading registers 0x00 to 0x20, that match the defaults specified in the LDC1000 data sheet. But reading the proximity registers in the same way I have read the other registers results in zeros.
I have left the INTB and TBCLK pins disconnected. I would just like to read the values of the proximity registers and so the INTB pin is of no use to me at this point (to my knowledge) and it would seem that connecting the TBCLK pin is only neccessary for reading frequency data?
I have scoped the INA and INB pins and there is a signal coming through from the coil so that connection seems fine.
Any help on why I am getting zeros would be greatly appreciated
Thank you in advance