Other Parts Discussed in Thread: FDC2214
Connection:
ESP32 <--> FDC2214EVM
- GND <--> GND
- 3.3V <--> 3.3V
- GPIO21 <--> SDA
- GPIO22 <--> SCL
My problem is that if i start the ESP32 normally the communication via I²C should start. But it is not working. I am using the FDC2214EVM without the USB-Part and without the 2 sensor areas. I am only using the breakout board with 4-channels. The funny thing is that it works when I reset my ESP32 microcontroller and put my finger on the SDA pin and the SCL pin at the same time. Probably the I²C bus will be short circuited for a short moment.
Additonally i am using the Arduino IDE to flash my ESP32 and for the FDC2214EVM i am using the LIb from https://github.com/zharijs/FDC2214.
My Code for the ESP32 is the following:
#include <Wire.h> #include "FDC2214.h" FDC2214 capsense(FDC2214_I2C_ADDR_0); // Use FDC2214_I2C_ADDR_1 byte FDC = 0x2A;// FDC address either 0x2A or 0x2B; int altzeit, delayzeit = 250; int g = 0; // Channel auf dem FDC2214 unsigned long capacity; // Value from Sensor-FDC2214 void setup() { Serial.begin(115200); Wire.begin(); //Wire.setClock(100000); Configure(); Wire.beginTransmission(FDC); } void loop() { if (millis() - altzeit > delayzeit) { altzeit = millis(); capacity = capsense.getReading28(g);// Befehl zum Lesen der Kapa. if (capacity > 0) { Serial.println(capacity); } } delay(20); } //Configuring the FDC2214 void writeConfig(int FDC, byte reg, byte MSB, byte LSB) { Wire.beginTransmission(FDC); Wire.write(reg); Wire.write(MSB); Wire.write(LSB); Wire.endTransmission(); } void Configure() { // based on best results with the TI demo program writeConfig(FDC, 0x1C, 0x80, 0x00); //Reset writeConfig(FDC, 0x08, 0xFF, 0xFF); writeConfig(FDC, 0x09, 0xFF, 0xFF); writeConfig(FDC, 0x0A, 0xFF, 0xFF); writeConfig(FDC, 0x10, 0x04, 0x00); writeConfig(FDC, 0x11, 0x04, 0x00); writeConfig(FDC, 0x12, 0x04, 0x00); writeConfig(FDC, 0x14, 0x10, 0x01); writeConfig(FDC, 0x15, 0x10, 0x01); writeConfig(FDC, 0x16, 0x10, 0x01); writeConfig(FDC, 0x19, 0x00, 0x01);//ERROR_CONFIG writeConfig(FDC, 0x1B, 0xC2, 0x0C);//MUX_CONFIG writeConfig(FDC, 0x1E, 0x88, 0x00); writeConfig(FDC, 0x1F, 0x88, 0x00); writeConfig(FDC, 0x20, 0x88, 0x00); writeConfig(FDC, 0x1A, 0x1E, 0x01);//CONFIG //writeConfig(FDC, 0x17, 0x10, 0x01);//CLOCK_DIVIDERS_CH3 //writeConfig(FDC, 0x21, 0x88, 0x00);//DRIVE_CURRENT_CH3 //writeConfig(FDC, 0x13, 0x04, 0x00);//SETTLECOUNT_CH3 //writeConfig(FDC, 0x0B, 0xFF, 0xFF);//RCOUNT_CH3 }