Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FDC2214

Other Parts Discussed in Thread: FDC2214

I solved register problem for channel-0 in FDC2214 but I dont know channel-1 address.

For example:channel-0

void Configuration() {
writeConfig(FDC, 0x14, 0x20, 0x01);//CLOCK_DIVIDERS_CH0
writeConfig(FDC, 0x1E, 0xF8, 0x00);//DRIVE_CURRENT_CH0
writeConfig(FDC, 0x10, 0x00, 0x0A);//SETTLECOUNT_CH0
writeConfig(FDC, 0x08, 0x69, 0xE8);//RCOUNT_CH0
writeConfig(FDC, 0x19, 0x00, 0x00);//ERROR_CONFIG
writeConfig(FDC, 0x1B, 0x02, 0x0C);//MUX_CONFIG
writeConfig(FDC, 0x1A, 0x14, 0x41);//CONFIG
}

channel-1???????

  • Hello,

    The first hex value in each command is the register address, i.e. 0x14, 0x1E, etc. Please check the FDC2214 datasheet for the corresponding register addresses for Ch1.

    Regards,
    Yibo
  • Hi Yibo Yu,

    Thank you for answering we look up FDC2214 datasheet and use register address for channel-1

    byte CH0MSB = 0x02; //Most significant bits of the conversion result on channel 0. [11:0]-->>[27:16]
    byte CH0LSB = 0X03; //Less significant bits of the conversion result on channel 0. [15:0]-->>[15:0]

    writeConfig(FDC, 0x15, 0x10, 0x01);//CLOCK_DIVIDERS_CH0
    writeConfig(FDC, 0x1F, 0xF8, 0x00);//DRIVE_CURRENT_CH0
    writeConfig(FDC, 0x11, 0x00, 0x0A);//SETTLECOUNT_CH0
    writeConfig(FDC, 0x09, 0x69, 0xE8);//RCOUNT_CH0
    writeConfig(FDC, 0x19, 0x00, 0x00);//ERROR_CONFIG
    writeConfig(FDC, 0x1B, 0x02, 0x0C);//MUX_CONFIG
    writeConfig(FDC, 0x1A, 0x14, 0x41);//CONFIG

    But it is not right . What do you think about this matter?

    Regards,
    Unal
  • Hi,

    I communicated fdc 2214 with ardunio, but i read only ch0. I want read another channel in same code, i write adreesses ch1, ch2 in datasheet but i read only value 0.I think, we have same problem.
    please hepl me.
    Regards,
    Orkun.
  • Hi Unal, Orkun,

    Are you trying to run each channel in continuous conversion or are you trying to sequence through every channel? Depending on what you want to do, you need to write different values in the CONFIG and MUX_CONFIG registers.

    For example, if you want to run only ch1 in continuous conversion mode, you will need to change the MSB value for the CONFIG register according to the datasheet.

    Thanks,
    Rachel
  • Hi Rachel Liao ,

    we want to take capacitive sensor FDC2214 data with Arduino SCL , SDA pın.when we take Channel-0 , we  read data for channel-0  with arduino code :

    //unsigned long 4 Bytes 0 to 4,294,967,295
    //long 4 Bytes -2,147,483,648 to 2,147,483,647
    //float 4 Bytes 1.2E-38 to 3.4E+38 (6 decimal places)
    #include <Wire.h>
    #define DT 1 //Derivative threshold.
    #define IT 1500 //Integration threshold.
    #define HAND 3500 // Hand threshold.
    #define AVGN 3 //Degree of the IIR filter.
    #define L 1 //Leakege Factor.

    byte FDC = 0x2B;// FDC address either 0x2A or 0x2B;
    byte CH0MSB = 0x00; //Most significant bits of the conversion result on channel 0. [11:0]-->>[27:16]
    byte CH0LSB = 0X01; //Less significant bits of the conversion result on channel 0. [15:0]-->>[15:0]


    void LedOn() {
    digitalWrite(2, HIGH);
    }

    void LedOff() {
    digitalWrite(2, LOW); //Target approaching!
    }

    //Build the complete conversion result from the specific channel
    unsigned long readChannel() {
    unsigned long val = 0;
    word c = 0;
    word d = 0;
    c = readValue(FDC, CH0MSB); 
    d = readValue(FDC, CH0LSB);
    val = c;
    val <<= 16;
    val += d;
    return val;
    }

    //Read bytes from register channel specified
    word readValue (int FDC, int reg) {
    byte a = 0;
    byte b = 0;
    word value = 0;
    Wire.beginTransmission(FDC);
    Wire.write(reg);
    Wire.endTransmission();
    Wire.requestFrom(FDC, 2);
    while (Wire.available())
    {
    a = Wire.read();
    b = Wire.read();
    }
    value = a;
    value <<= 8;
    value += b;
    return value;
    }


    //IIR Filter
    long average( unsigned long meassure, long avg_1, int n) {
    long avg = ((avg_1 * n) - avg_1 + meassure) / n;
    return avg;
    }

    void monitor() {
    long current = readChannel();
    long delta = 0, Integral = 0, Integral_1 = 0;
    long avg = 0, avg_1 = 0, last = 0;
    //avg = current;

    for (;;) {

    last = current;// Shift register. The variable last will storage the current value for the next iteration.
    current = average(readChannel(), last, AVGN);//New value for current return from IIR filter --> function average(meassure, avg_1, n)

    //Derivative integration algorithm
    delta = current - last;

    if (abs(delta) > DT) {
    Integral = Integral_1 + delta;
    }
    else {
    Integral = Integral_1;
    }

    if (abs(Integral) >= IT && abs(Integral) < HAND) {
    LedOff();
    Integral_1 = Integral;
    Serial.println("Pot approaching...");
    }
    else {
    LedOn();
    Integral_1 = Integral * L;
    }
    Serial.println(abs(Integral));
    delay(100);
    }
    }


    //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 Configuration() {
    writeConfig(FDC, 0x14, 0x20, 0x01);//CLOCK_DIVIDERS_CH0
    writeConfig(FDC, 0x1E, 0xF8, 0x00);//DRIVE_CURRENT_CH0
    writeConfig(FDC, 0x10, 0x00, 0x0A);//SETTLECOUNT_CH0
    writeConfig(FDC, 0x08, 0x69, 0xE8);//RCOUNT_CH0
    writeConfig(FDC, 0x19, 0x00, 0x00);//ERROR_CONFIG
    writeConfig(FDC, 0x1B, 0x02, 0x0C);//MUX_CONFIG
    writeConfig(FDC, 0x1A, 0x14, 0x41);//CONFIG
    }


    void setup() {
    Wire.begin();
    Serial.begin(9600);
    Serial.println("Starting");
    pinMode(2, OUTPUT);
    Configuration();
    }

    void loop() {
    Wire.beginTransmission(FDC);
    monitor();
    }

    this code is right for channel-0 but ;

    we look up datasheet  and we change Register address for channel-1 :

    byte FDC = 0x2B;// FDC address either 0x2A or 0x2B;
    byte CH0MSB = 0x02; //Most significant bits of the conversion result on channel 0. [11:0]-->>[27:16]
    byte CH0LSB = 0X03; //Less significant bits of the conversion result on channel 0. [15:0]-->>[15:0]

    void Configuration() {
    writeConfig(FDC, 0x15, 0x20, 0x01);//CLOCK_DIVIDERS_CH0
    writeConfig(FDC, 0x1F, 0xF8, 0x00);//DRIVE_CURRENT_CH0
    writeConfig(FDC, 0x11, 0x00, 0x0A);//SETTLECOUNT_CH0
    writeConfig(FDC, 0x09, 0x69, 0xE8);//RCOUNT_CH0
    writeConfig(FDC, 0x19, 0x00, 0x00);//ERROR_CONFIG
    writeConfig(FDC, 0x1B, 0x02, 0x0C);//MUX_CONFIG
    writeConfig(FDC, 0x1A, 0x14, 0x41);//CONFIG
    }

    but data is not right.I send to picture for Arduino and FDC2214 electronic schema.

    Where is wrong this code and schema.

    Please help me!!!

    Regards,

    Unal

  • Hi Unal,

    Like I mentioned in my previous post, you will need to change the values you are writing into the CONFIG register in order to enable streaming from CH1. Right now, when you write 0x14 as the MSB value for the CONFIG register, you are performing continuous conversions on CH0. Instead, you need to write 0x54 if you want to perform continuous conversions on CH1. You may also need to check the other register values to ensure you are configuring the device correctly for CH1.

    Thanks,

    Rachel

  • Hi Rachel Liao ,

    I do what you say but still doing reading from Channel-0 , so was annoying situation. Where did you find the address 0x54.
    I dont find this address in datasheet.

    Thanks,

    Unal
  • Hi Unal,

    Based on the MSB you wrote into the CONFIG register, 0x14, you're setting your ACTIVE_CHAN field to 00 which selects CH0. In order to select CH1 instead, you need to set your ACTIVE_CHAN field to 01. In doing so, your hex value will change to 0x54. Please refer to Section 9.6.28 of the datasheet.

    Another thing to double check is your CLKIN pin. It seems like you are selecting the internal oscillator as the reference frequency. If that's the case, you also need to make sure your CLKIN pin is tied to GND instead of to the external oscillator.

    Thanks,

    Rachel

  • Hi Rachel,

    I am very sorry. But I dont read Channel-1 or channel-2 or channel-3 data.
    I made the changes you said but it is not.

    Can you writing Channel-1 Register address values.
    And I have got a new problem My capacitive gain is very low. How it is to increase capacitive values.

    What would you suggest me about sensitive capacitive sensor. I want to do sensitive proccess .

    Thanks ,

    Unal
  • Hi Unal,

    Could you probe the waveforms on CH0 and CH1 with their respective configurations? What are your oscillation frequencies and amplitudes?

    Thanks,

    Rachel

  • Hi Rachel,

    Oscillation frequncies: 33 Mhz but there is not any amplitudes. İt is cihanging.
    For example sometimes amplitudes: 100 pF
    Sometimes amplitudes: 80 PF

    Thanks,

    Unal
  • Hi Unal,

    Did you mean 3.3 MHz?

    I meant probe the signal on the CH0 and CH1 lines using an oscilloscope. I'm curious to see if the signals are both a half-sine wave (as it should be) with the amplitudes between 1.2 V and 1.8 V.

    Thanks,
    Rachel