Library to work with the LDC1000 from Texas Instruments
LDC1000
This library was written to interface to Texas Instruments' LDC1000 in order to perform inductance measurement. This libary needs a SPI peripheral on your mbed device to talk to the LDC1000.
Clock
The LDC1000 needs a high speed clock for its internal frequency counter. In order to provide this clock, the FastPWM library is used. This may change the behaviour of other PWM channels, please be aware of that, and read the FastPWM documentation to understand the implications.
Unsupported
Not supported (yet):
- Setting the RpMAX and RpMIN values
- Setting the interrupt pin functionality
Diff: LDC1000.cpp
- Revision:
- 10:4fa62f8092c4
- Parent:
- 9:6e2d808b113d
- Child:
- 11:0f53fbf73613
--- a/LDC1000.cpp Fri May 29 11:25:13 2015 +0000 +++ b/LDC1000.cpp Fri May 29 13:35:48 2015 +0000 @@ -28,20 +28,20 @@ setOutputPower(LDC_AMPLITUDE_4V); //*** Write comando's like in EVM start log: -/* writeSPIregister(0x0B,0x00); */ - writeSPIregister(0x01,0x0E); - writeSPIregister(0x02,0x3C); - writeSPIregister(0x03,0x15); - writeSPIregister(0x04,0x17); - writeSPIregister(0x05,0x00); - writeSPIregister(0x06,0x50); - writeSPIregister(0x07,0x14); - writeSPIregister(0x08,0xC0); - writeSPIregister(0x09,0x12); - writeSPIregister(0x0A,0x04); - writeSPIregister(0x0C,0x01); - writeSPIregister(0x0B,0x01);/* -*/ +/* writeSPIregister(0x0B,0x00); // power op standby + writeSPIregister(0x01,0x0E); // rp_max + writeSPIregister(0x02,0x3C); // rp_min + writeSPIregister(0x03,0x15); // min reson freq + writeSPIregister(0x04,0x17);*/ // LDC config + writeSPIregister(0x05,0x00); // clock config >> we get 0x00 if this line is disabled and the cable is reconnected +/* writeSPIregister(0x06,0x50); // treshhold High LSB we get 0x00 if this 4 lines is disabled and the cable is reconnected + writeSPIregister(0x07,0x14); // treshhold High MSB + writeSPIregister(0x08,0xC0); // treshhold Low LSB + writeSPIregister(0x09,0x12); // treshhold Low MSB + writeSPIregister(0x0A,0x04); */ // INTB pin config + writeSPIregister(0x0C,0x01); // + // writeSPIregister(0x0B,0x01); // Power mode active + mode(LDC_MODE_ACTIVE); }