Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for clarification about capacitance value determination #6

Open
Bhindhiya opened this issue Jul 12, 2023 · 0 comments
Open

Comments

@Bhindhiya
Copy link

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.

image

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant