Hello!
Looking for some guidance on how I should start debugging an issue I'm experiencing trying to get the Zephyr fdc2x1x sample code running on a custom PCB that uses the XIAO BLE Sense (nRF52840). I have a custom PCB with two FDC2214 capacitive sensor ICs with I2C addresses 0x2A and 0x2B. To verify at least the 0x2A IC was working correctly, I created a copy of the fdc2x1x sample and added a build configuration based on the nRF9160DK. I wired ground and the I2C pins from my nRF9160DK up to the corresponding pins on my custom PCB, flashed the sample code onto the board and opened a serial terminal (note the shutdown pin of the 0x2A FDC2214 was pulled low in this setup to guarantee it was enabled). I can immediately see the sensor data print out showing that the nRF9160 is successfully talking with the IC. I then created a new build configuration based on the XIAO BLE Sense board, copied the nRF9160 overlay file, and updated it to match the corresponding I2C bus and pin definitions for shutdown and interrupt (see code below) based on the XIAO BLE Sense schematic and device tree. I then repeated the experiment of building the code, flashing it and opening the COM port serial terminal. Instead of getting sensor data I got the following message:
Electrically the only difference between the two test cases is the XIAO BLE Sense is directly controlling the shutdown pin of the FDC2214 (which I have verified goes low when the board powers on), versus in the nRF9160 case I am forcing it to always be enabled (low). My current best guess as to why this isn't working is 1) Something to do with the timing of the shutdown pin going low and when the driver tries to initialize the IC. 2) An error with my overlay or the XIAO BLE Sense device tree. 3) Something with pin MUXing not being handled correctly on the XIAO BLE Sense.
My Setup:
OS: Windows 11
Dev Environment: VS Code 1.95.1
Toolkit: nRF Connect SDK for VS Code
SDK: nRF Connect SDK 2.6.1
Programmer: J-Link Edu Mini
Board: Xiao BLE Sense (Schematic) & nRF9160DK
xiao_ble_sense.overlay:
/* * Copyright (c) 2020 arithmetics.io * * SPDX-License-Identifier: Apache-2.0 */ &i2c1 { clock-frequency = <I2C_BITRATE_FAST>; fdc2x1x@2A { compatible = "ti,fdc2x1x"; reg = <0x2A>; sd-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; intb-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; autoscan; deglitch = <5>; fref = <43360>; channel_0 { rcount = <7499>; settlecount = <48>; fref-divider = <1>; idrive = <10>; fin-sel = <2>; inductance = < 18 >; }; channel_1 { rcount = <7499>; settlecount = <48>; fref-divider = <1>; idrive = <10>; fin-sel = <2>; inductance = <18>; }; }; };
nrf9160dk_nrf9160.overlay:
/*
* Copyright (c) 2020 arithmetics.io
*
* SPDX-License-Identifier: Apache-2.0
*/
&i2c2 {
clock-frequency = <I2C_BITRATE_FAST>;
fdc2x1x@2A {
compatible = "ti,fdc2x1x";
reg = <0x2A>;
sd-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
intb-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
autoscan;
deglitch = <5>;
fref = <43360>;
channel_0 {
rcount = <7499>;
settlecount = <48>;
fref-divider = <1>;
idrive = <10>;
fin-sel = <2>;
inductance = < 18 >;
};
channel_1 {
rcount = <7499>;
settlecount = <48>;
fref-divider = <1>;
idrive = <10>;
fin-sel = <2>;
inductance = <18>;
};
};
};
Let me know if you have any ideas on what I should try testing first, or if you require any additional information on the setup.
Cheers,
Parker