You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thank you for providing this library. It has been very useful to configure and observe FDC1004 behavior.
I humbly request your help to better understand two aspects of your code.
1. Why is the capacitance value calculation done in the following manner for the board?
Following code snippet is from the example code int16_t msb = (int16_t) value[0]; int32_t capacitance = ((int32_t)457) * ((int32_t)msb); //in attofarads capacitance /= 1000; //in femtofarads capacitance += ((int32_t)3028) * ((int32_t)capdac);
Why is capacitance calculated in this manner? What is the significance of 457 and 3028?
According to FDC1004 datasheet (page 16), we are required to calculate the 2's complement of the measured value and divide the same by 2^19 to find the capacitance (pF) value. Please correct me if my understanding is incorrect.
2. Why are we not using the measurement LSB value in the calculation?
Based on FDC1004 datasheet, I understand 24-bit data is available after capacitance measurement from FDC1004. Only bits [0:7] are reserved and the bits [8:15] of LSB register hold valid data. However, we are ignoring this value (bits [8:15] of LSB register) during the calculation. I request you to please clarify the reason for this.
Looking forward to hearing from you as it would be very helpful to me. Thank you!
The text was updated successfully, but these errors were encountered:
Hi!
Firstly, thank you for providing this library. It has been very useful to configure and observe FDC1004 behavior.
I humbly request your help to better understand two aspects of your code.
1. Why is the capacitance value calculation done in the following manner for the board?
Following code snippet is from the example code
int16_t msb = (int16_t) value[0];
int32_t capacitance = ((int32_t)457) * ((int32_t)msb); //in attofarads
capacitance /= 1000; //in femtofarads
capacitance += ((int32_t)3028) * ((int32_t)capdac);
Why is capacitance calculated in this manner? What is the significance of 457 and 3028?
According to FDC1004 datasheet (page 16), we are required to calculate the 2's complement of the measured value and divide the same by 2^19 to find the capacitance (pF) value. Please correct me if my understanding is incorrect.
2. Why are we not using the measurement LSB value in the calculation?
Based on FDC1004 datasheet, I understand 24-bit data is available after capacitance measurement from FDC1004. Only bits [0:7] are reserved and the bits [8:15] of LSB register hold valid data. However, we are ignoring this value (bits [8:15] of LSB register) during the calculation. I request you to please clarify the reason for this.
Looking forward to hearing from you as it would be very helpful to me. Thank you!
The text was updated successfully, but these errors were encountered: