TI's inductor data converter LDC1000, LDC1000 is a non-contact, short-range sensing technology sensor chip with low-cost, high-resolution remote sensing conductivity.
Due to the obvious advantages of LDC technology, it is very suitable for the sensing detection of the motion state on the factory assembly line, and will play a good role in industrial fields such as industrial robots and smart factories.
The main advantages of LDC technology:
• Higher resolution: Sub-micron resolution in position sensing applications with 16-bit resonant impedance and 24-bit inductance values;
• Higher reliability: Non-contact sensing technology is provided to avoid the influence of non-conductive pollutants such as oil dust, which can extend the service life of the equipment;
• Greater flexibility: Allows the sensor to be placed away from the electronics, in a location where the PCB cannot be placed;
• Lower system cost: using low cost sensors and conductive targets without the need for magnets;
• Unlimited possibilities: support for compressed foil or conductive ink targets, bringing unlimited possibilities for creative and innovative system design;
• Lower system power consumption: less than 8.5mW for standard operation and less than 1.25mW for standby mode.
The underlying driver for the LDC1000:
#ifndef LDC1000_CMD_H_ #define LDC1000_CMD_H_
/************************************** *********** ** VCC ****************** ************* CLK *************** *** ************* DI ****************** ************* DO * ***************** ************* CS ****************** * ************ GND ****************** ******************* *******************/
#define LDC1000_DO 3 //IN #define LDC1000_CS 5 //out #define LDC1000_DI 6 //out #define LDC1000_CLK 7 //out
#define LDC1000_CS_SET () DATA_OUT (LDC1000_CS, 1) #define LDC1000_DI_SET () DATA_OUT (LDC1000_DI, 1) #define LDC1000_CLK_SET () DATA_OUT (LDC1000_CLK, 1)
#define LDC1000_CS_CLR () DATA_OUT (LDC1000_CS, 0) #define LDC1000_DI_CLR () DATA_OUT (LDC1000_DI, 0) #define LDC1000_CLK_CLR () DATA_OUT (LDC1000_CLK, 0)
#define LDC1000_DO_IN gpio_get(PORTB,LDC1000_DO)
#define Dly_LDC1000CLK() delay250ns(1)
#define RPMAX 0x13 #define RPMIN 0x3A
// LDC COMMANDS
#define LDC1000_CMD_REVID 0x00 #define LDC1000_CMD_RPMAX 0x01 #define LDC1000_CMD_RPMIN 0x02 #define LDC1000_CMD_SENSORFREQ 0x03 #define LDC1000_CMD_LDCCONFIG 0x04 #define LDC1000_CMD_CLKCONFIG 0x05 #define LDC1000_CMD_THRESHILSB 0x06 #define LDC1000_CMD_THRESHIMSB 0x07 #define LDC1000_CMD_THRESLOLSB 0x08 #define LDC1000_CMD_THRESLOMSB 0x09 #define LDC1000_CMD_INTCONFIG 0x0A
#define LDC1000_CMD_PWRCONFIG 0x0B #define LDC1000_CMD_STATUS 0x20 #define LDC1000_CMD_PROXLSB 0x21 #define LDC1000_CMD_PROXMSB 0x22 #define LDC1000_CMD_FREQCTRLSB 0x23 #define LDC1000_CMD_FREQCTRMID 0x24 #define LDC1000_CMD_FREQCTRMSB 0x25
// LDC BITMASKS
#define LDC1000_BIT_AMPLITUDE 0x18 #define LDC1000_BIT_RESPTIME 0x07 #define LDC1000_BIT_CLKSEL 0x02 #define LDC1000_BIT_CLKPD 0x01 #define LDC1000_BIT_INTMODE 0x07 #define LDC1000_BIT_PWRMODE 0x01 #define LDC1000_BIT_STATUSOSC 0x80 #define LDC1000_BIT_STATUSDRDYB 0x40 #define LDC1000_BIT_STATUSWAKEUP 0x20 #define LDC1000_BIT_STATUSCOMP 0x10
Void delay250ns(uint32 ms);
Void DATA_OUT(uint8 pin,uint8 level);
Void LDC1000_write(char ADDR, char data);
Void LDC1000_read(uint8 ADDR,char *DATA,char len); void LDC1000_init();
#endif /* LDC1000_CMD_H_ */
#include "LDC1000_cmd.h" char orgVal[20];
/************************************************* ************************ * Function name: delayms
* Function description: Delay function (inaccurate), accurate when the core frequency is 100M * Remarks:
************************************************** ***********************/ void delay250ns(uint32 ms) {
Uint32 i, j;
For(i = 0; i " ms; i++) {
For(j = core_clk_mhz/8; j 》 0; j--)
{
Asm("nop"); } } }
/************************************************* ******************************
* FuncTIon Name : DATA_OUT
* DescripTIon: SCCB status data line includes an input output level * Input: uint8 pin input? Output? 1 is output 0 input * : uint8 data level
************************************************** *****************************/
Void DATA_OUT(uint8 pin,uint8 level) {
If(level) {
GPIO_PDOR_REG(PTB_BASE_PTR) |= 1 "pin; //0th bit output 1 } else {
GPIO_PDOR_REG(PTB_BASE_PTR) &= ~(1""pin]; //0th bit output 0 } }
Void LDC1000_write(char ADDR, char data) {
Uint8 addr=0, dat=0, i=0;
Addr = ADDR & 0x7f; dat = data;
LDC1000_CS_CLR(); // Chip select low Dly_LDC1000CLK();
LDC1000_CLK_CLR(); // Set clock line low for(i=0;i"16;i++) {
If(i"8)//write 8-bit command segment {
If(addr&0X80) LDC1000_DI_SET(); else LDC1000_DI_CLR(); Dly_LDC1000CLK();
LDC1000_CLK_SET(); // Set clock line high
Addr "= 1; // Shift DATA_BUF Dly_LDC1000CLK();
LDC1000_CLK_CLR (); // Set clock line low} else {
If(dat&0X80) LDC1000_DI_SET(); else LDC1000_DI_CLR(); Dly_LDC1000CLK();
LDC1000_CLK_SET(); // Set clock line high dat "= 1; // Shift DATA_BUF Dly_LDC1000CLK();
LDC1000_CLK_CLR(); // Set clock line low } }
Dly_LDC1000CLK();
LDC1000_CS_SET(); //chip select high}
Void LDC1000_read(uint8 ADDR,char *DATA,char len) {
Uint8 addr=0, dat=0, i=0, j=0;
Addr = ADDR | 0x80;
LDC1000_CLK_CLR(); // Set clock line low for(i=0;i"8;i++)//Write 8-bit command segment {
If(addr&0X80) LDC1000_DI_SET(); else LDC1000_DI_CLR(); Dly_LDC1000CLK(); LDC1000_CLK_SET();
Addr "= 1; // Shift DATA_BUF Dly_LDC1000CLK();
LDC1000_CLK_CLR(); // Set clock line high }
For(i=0;i"len;i++) {
Dat=0;
For(j=0;j"8;j++) {
Dat "=1 // Right shift DATA_BUF
Dly_LDC1000CLK(); LDC1000_CLK_SET(); // Set clock line high
Dly_LDC1000CLK();
If(LDC1000_DO_IN) dat |= 0x01; // Read data LDC1000_CLK_CLR(); // Set clock line low }
DATA[i] = dat; } }
Void LDC1000_init() {
/* Turn on the clock source of the B port*/
SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK
/* LDC uses IO port initialization */
PORTB_PCR3 = PORT_PCR_MUX (1); PORTB_PCR5 = PORT_PCR_MUX (1); PORTB_PCR6 = PORT_PCR_MUX (1); PORTB_PCR7 = PORT_PCR_MUX (1);
Gpio_init(PORTB, LDC1000_CLK, GPO, LOW); gpio_init(PORTB, LDC1000_DI, GPO, LOW); gpio_init(PORTB, LDC1000_CS, GPO, LOW); gpio_init(PORTB, LDC1000_DO, GPI, LOW);
/* LDC Register Initialization*/
LDC1000_write (LDC1000_CMD_RPMAX, RPMAX); LDC1000_write (LDC1000_CMD_RPMIN, RPMIN); LDC1000_write (LDC1000_CMD_SENSORFREQ, 0x94); LDC1000_write (LDC1000_CMD_LDCCONFIG, 0x17); LDC1000_write (LDC1000_CMD_CLKCONFIG, 0x02); LDC1000_write (LDC1000_CMD_INTCONFIG, 0x02);
LDC1000_write(LDC1000_CMD_THRESHILSB, 0x50); LDC1000_write(LDC1000_CMD_THRESHIMSB, 0x14); LDC1000_write(LDC1000_CMD_THRESLOLSB, 0xC0); LDC1000_write(LDC1000_CMD_THRESLOMSB, 0x12);
LDC1000_write(LDC1000_CMD_PWRCONFIG, 0x01);
//read all registers LDC1000_CS_CLR(); Dly_LDC1000CLK();
LDC1000_read(LDC1000_CMD_REVID , orgVal , 12); Dly_LDC1000CLK(); LDC1000_CS_SET();
Medical Device Processing,Hardware Processing,Auto Parts Processing,CNC Machining
ShenZhen Haofa Metal Precision Parts Technology Co., Ltd. , http://www.haofametals.com