Using with FDC2112, 1st channel transmits only 0x40000, 0x30000 and 0x20000
Closed this issue · 2 comments
Hello!
Has anyone tested this on the FDC2112?
I've connected FDC2112 to an Arduino as follows:
Arduino | Level shifter | FDC2112
5V ---| HV LV |--- 3.3V
3.3V ---|---------------|-'
GND ---| GND GND |--- GND
A4 ---| HV1 LV1 |--- SDA
A5 ---| HV2 LV2 |--- SCL
I've run testFDC-Serial.ino
:
FDC2214/examples/testFDC-Serial/testFDC-Serial.ino
Lines 48 to 68 in 8dc2368
with the following modifications:
Uncomment
Comment out
Change 4 to 2
Change 28 to 16
Add HEX argument to print to see what's happening more clearly:
This results in the 2 channels only ever transmitting 0s. Setting intOsc
to true on line 48 results in channel 0 transmitting 40000 , 30000, or 20000 (I am using this skin capacitance sensor (schematic)).
This is obviously a very low resolution, much less than the advertised 12 bits. I've tried changing the MSB address, but unfortunately all values between 0x00-0x07 are just FFFs (i.e. channel 0 transmits FFF0000 for FDC2214_DATA_CH0_MSB being set to any of 0x00-0x07).
Update: after having a good look at the datasheet, a solution is to change the gain flag to 0b11:
// Set the gain flag of the moisture sensor
uint16_t gainFlag = capsense.read16FDC(0x1C);
Serial.println(gainFlag, HEX);
capsense.write16FDC(0x1C, 0x3 << 9);
gainFlag = capsense.read16FDC(0x1C);
Serial.println(gainFlag, HEX);
This results in a 6-bit resolution, which was good enough for my application. This only applies to the FDC2112 and FDC2114.
have you used moisture click that uses FDC2112 if yes please send me the full code you used to integrate FDC 2112