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.

FDC2212 Frequency Conversion

Other Parts Discussed in Thread: FDC2212, FDC1004, FDC2214

 

Hello,

I  am using FDC2212 for level sensing.For that i am using single ended sensor configuration and only single channel.

 We designed our own board.

I have some doubts about configuration and conversion of frequency.

1)What is ENOB for FDC2212?

2)Can you explain about the frequency conversion equation 7 and 9(Page no.19).In equation 9 what value should be given to Fref. because we are using external oscillator (40 MHz) for Fref and according to datasheet  Fref must be ≤35 MHz for single channel so i configured CH0_FREF_DIVIDER as 2.so we need to give hard coded value for Fref ?

3)Please explain Amplitude Correction in Single-channel Mode Sequencing(Page no 16),for that we need to give any delay?

  • Hi:

    The FDC2212 has a 28-bit ADC. The ENOB is basically the number of bits you actually get relative to the noise and distortion. The reference count value must be chosen to support the required ENOB. For example if an ENOB of 13 bits is required, then a min conversion time of 2^13 = 8192 clock cycles is required. 8192 clock cycles correspond to a RCOUNT value of 0x2000.

    Fref is your reference freq. To be valid and within specs, Fref must be 40MHz/2. But by making your Fref smaller, your resolution decreases. Another way is to use both channels and take conversion. you would set CH0 to whatever your desired conversion time and then CH1 would basically be a dummy read. You would set CH1 to have like an extremely low settle count and RCOUNT so the conversion time is in the microsecond range and will not affect performance, depending on sampling rate of CH0.

    Amplitude correction is not a supported feature in FDC2212, but you will see a few cycle delay for that. Very small affect on total conversion time.

    Thanks
    -David Wang
    Capacitive Sensing Application
  • Hi David,

    Thank you for your reply.

    As you suggested i will also try with the use of both channel for our application.

    I have some more doubt

    1)When i changing the IDRIVE current value to set Oscillation Amplitude value between 1.2V to 1.8V, Frequency is also changing with respect to current.if Current is increasing,freqency is decreasing or vice versa.

    2)When i setting the IDRIVE value low which is correspond to low oscillation amplitude i.e. < 1.2V, ERR_ALW bit is not setting in STATUS Register and when i setting IDRIVE value high which is correspond to high oscillation amplitude i.e. > 1.8V, ERR_AHW bit is not setting in STATUS Register.
    But when i unmasked the AH_WARN2OUT and AL_WARN2OUT bit in ERROR_CONFIG Register,CH0_ERR_AW bit is set in DATA_CH0 Register.

    3)Any effect on DATA value when any Ampl;itude warning is there.
  • Hi David,

    Thank you for your reply.

    As you suggested i will also try with the use of both channel for our application.

    I have some more doubt

    1)When i changing the IDRIVE current value to set Oscillation Amplitude value
    between 1.2V to 1.8V, Frequency is also changing with respect to current.if Current
    is increasing,freqency is decreasing or vice versa.

    2)When i setting the IDRIVE value low which is correspond to low oscillation
    amplitude i.e. < 1.2V, ERR_ALW bit is not setting in STATUS Register and when i
    setting IDRIVE value high which is correspond to high oscillation amplitude i.e. >
    1.8V, ERR_AHW bit is not setting in STATUS Register.

    But when i unmasked the AH_WARN2OUT and AL_WARN2OUT bit in ERROR_CONFIG
    Register,CH0_ERR_AW bit is set in DATA_CH0 Register.

    3)Any effect on DATA value when any Ampl;itude warning is there.
  • Hi

    Frequency should not change drastically, it should be extremely small compared the unit of measurement (MHz). Even if you were trying to get an exact measurement, your oscilloscope probe will load the signal capacitively so it will not be exact even if you used a FET probe which still has ~1-2pF of capacitance.

    If you select to enable the L and H Amplitude Warnings in the configuration registers, you should see it both in the measurement registers and also the status register. Even if you do not enable it, you should still see the warning flag in the measurement registers.

    There is no effect on data with the warning.

    Thanks
    -David Wang
    Capacitive Sensing Applications
  • Hi David,

    Thanks for your quick reply.

    Yes change in frequency is very small compared the unit of measurement (MHz) and when i checking with oscilloscope, frequency is decreasing because oscilloscope probe has 20 pF capacitance.

    but When i enabled the L and H Amplitude Warnings in the configuration registers, it is changing only in the measurement registers not in the status register and it is mentioned in the datasheet,warning flag in the measurement register is updating only when we unmasked the correspond bit in the ERROR CONFIG register.

    I have another doubt before that we were using the FDC1004 for same Level sensing,
    when i was using the FDC1004 for same Level Sensing Application and when i connected the same sensor(Cylindrical) , capacitance of the sensor is 24pF. now i am using FDC2212 for the same sensor the capacitance is reduced to 13.5pF that is almost half.it is okay or i am doing something wrong in configuration.

    Thanks
    Shoaib Ahmed
  • Verify that you have enabled the bits in the error config register. Then you need to make sure that the you see it in the status register first and then in the measurement. If you read the status register, all of the flags will reset.

    As for the difference in pF. If you are using the fdc2214 EVM, it approvingly because you still have a 33pf fixed cap in parallel. You need to connect one electrode to INA and then the other electrode to INB so it's in a differential config. The fixed cap is not needed, and if you have it it will actually reduce your sensitivity. Depending on your frequency, you should use the clock divider. Please refer to the datasheet.

  • Hi,
    I enabled the bits in ERROR_CONFIG and firstly i am reading the status register and then measurement register but Amplitude warning flag is not updating in status register.Below is the code and i also attached output text file.
    unsigned char buff[2];
    unsigned char buf[200];
    unsigned char Reg_char[2];
    float freq;
    double Open_Cap;
    union
    {
       unsigned char Cap1_byte[4];  
       unsigned long Cap1_Count;
    }CAP1;
    void FDC_Read_Capacitance(void) 
    {
    if(I2CW_R(FDC2212_ADDRS, 0X18, (unsigned char*)&buff, 2, 1) == 0)
    {
    I2C_STOP;
    }
    if(buff[0] & 0x06)
    {
    SEND_STRING_USART("\r\nAPMPLITUDE WARNING in STATUS Reg ");
    }
    else
    {
    SEND_STRING_USART("\r\nAMPLITUDE oK");
    }
    if((buff[1]) & (0x40))   //Wait For DATA Ready
    {
    if(I2CW_R(FDC2212_ADDRS, 0X00, (unsigned char*)&buff, 2, 1) == 0)
    {
    I2C_STOP;
    }
    CAP1.Cap1_byte[3] = buff[0];  
    CAP1.Cap1_byte[2] = buff[1];
    if(buff[0] & 0x10)
    {
    SEND_STRING_USART("\r\nAmplitude Warning in DATA Reg");
    }
    else
    {
    SEND_STRING_USART("\r\nNO Warning in DATA Reg");
    }
    CAP1.Cap1_byte[3] &=0x0F;
    _delay_ms(1);    
    if(I2CW_R(FDC2212_ADDRS, 0X01, (unsigned char*)&buff, 2, 1) == 0)
    {
    I2C_STOP;
    }
    CAP1.Cap1_byte[1] = buff[0];
    CAP1.Cap1_byte[0] = buff[1];
    sprintf((char*)&buf, "\r\nData:%lx", CAP1.Cap1_Count);
    SEND_STRING_USART((char*)buf);
    freq = ((2*20000000*(float)(CAP1.Cap1_Count))/268435456);
    freq /=1000000;
    Open_Cap = (1000000/(18*(square(2*M_PI*freq))));
    Open_Cap *=1000;
    sprintf((char*)&buf, "\r\nFreq_MHz:%f",(double)freq);
    SEND_STRING_USART((char*)buf);
    sprintf((char*)&buf, "\tOpen_Cap_fF:%.3f",Open_Cap);
    SEND_STRING_USART((char*)buf);
    }
    }
    int main(void)
    {
    /**** CONFIGURATION*****/

    Write_FDC2212(0x1C,0x0000); //RESET
    Write_FDC2212(0x14,0x2002); //CLK_DIV
    Write_FDC2212(0x1E,0x7800); //IDRIVE
    Write_FDC2212(0x10,0x0100); //SETTLE COUNT 4us
    Write_FDC2212(0x08,0x2089); //CONVERSION TIME 6.66ms(100SPS)
    Write_FDC2212(0x1B,0x020D); //MUX_CONFIG
    Write_FDC2212(0x19,0x3821); //ERROR_CONFIG
    Write_FDC2212(0x1A,0x1681); //CONFIG WITH SLEEP Disable

    while(1)
    {
    FDC_Read_Capacitance();
    _delay_ms(1000);
    }
    return 0;
    }
  • Hi David,

    We are not using FDC2214 EVM,We designed our own board.

    As you suggested i tried with Differential sensor configuration and i connected a 18 pf fix capacitor parallel to 33pF fix cap for that i am getting 17pF output which is near by 18pF but when i am using Single Ended configuration i am getting only 8.6pF that is half of 17 pF,why?

    how we get accurate measurement with Single Ended Configuration?
  • Ok, our team will look into the issue more closely to see what is happening with the error flags.

  • The capacitances are in parallel. For liquid level sensing you typically have two electrodes for the FDC2212/4. One connected to INA and one connected to INB. The fringing capacitance is measured between these two electrodes. If you only have a single-ended configuration for liquid level sensing, the fields terminate at the nearest ground potential and are not isolated to a certain region. This could cause issues, so we do not support that. For differential configuration, a parallel fixed cap is not necessary. The EVM only has it to allow single ended configuration for like proximity sensing. If that cap wasn't there, then the tank will not oscillate
  • OK, so the enable bits that you set are only to output the error flags in the measurements. I confirmed with the team and the FDC2214 does not support the amplitude H and L flags in the status register. So the best way is to just read the data and parse that information to determine if you have an error or not.

    Thanks
    -David Wang
    Capacitive Sensing Applications
  • Hi David,

    Ok Thanks for your reply.

  • Hi David,

    i tried with Differntial configuration for that one electrode connected to INA and another one connected to INB but the value of Capacitance is changing drastically like 300 to 600 fF and for our application we need very much accuracy.i also removed 33 pF cap after that same variation in the Capacitance.

    Any suggestion for Single Ended Configuration.
  • The variation in capacitance may be due to your system setup.

    We do not suggest single endEd configuration.