zharijs/FDC2214

the data is always 0

Closed this issue · 14 comments

Hello. I attached my FDC2214 to an arduino UNO or Leonardo, but it both couldn't work properly. In serial monitor, it shows 'Sensor OK' but the numbers it read are always "0,0,0,0", what's the matter?
image

I'm also experiencing this problem. Please post here if you find a solution.

From the datasheet of http://www.ti.com/lit/ds/snoscz5a/snoscz5a.pdf at the bottom of page 4, you need to ensure that there is a clock working at a certain frequency specified by the source code. But some of the EVM board have no internal clock, you have to add it externally.
By the way, I found that it is no need to add I2C level shifter since some of the Arduino board can accept the 3.3V digital signal.

If I have connected the CLKIN to GND to use the internal clock should I uncomment the line //Wire.setClock(400000L);? What clock freq are you using for the external clock?

Sorry, where is the code you referred to? I didn't see it.
I thought that there wouldn't be any internal clock in my EVM board, so I add the external clock in 10MHz.

If i use the internal clock,how can i fix the problem?

sorry here is the code I am using https://github.com/zharijs/FDC2214/blob/master/examples/testFDC-Serial/testFDC-Serial.ino . I'm using a breakout board for qfn packages.

I‘m also use this code and the breakout board for qfn packages, but the data for each channel returned by this program is all zero.

I am sorry that I cannot provide further help as I have not seen what is on the board that has an internal clock. But you may check the Vcc and find out what exactly your internal clock frequency is. And you should keep the frequency set in the code the same as that internal clock frequency. Maybe it is "deglitch" in the source code?

I believe the internal clock is 40Mhz if you tie CLKIN to GND. I will try changing the deglitch.

Hi guys,

I have a lack of time to go in to this one with proper attitude, so I am not planning to do any work towards support of internal oscillator. That mode is shit, the frequency can vary more than 10%, I don't see any point in using that. If you do not need the precision and stability of this chip + external oscillator, I strongly suggest you to use simple capture-compare circuit with arduino timer and no external dedicated chip at all. This is waste of money and board space without the proper clocking.

http://e2e.ti.com/support/sensor/capacitive-sensing/f/987/t/652975#
^- here a guy from TI says that intosc can be anything from 35 to 55 MHz

What I will do in next couple of days - I will fix the issue with ch3 and ch4 not working properly and add a schematic with partnumbers of parts I used on my board, so there are no more questions about L-C-OSC choices.

If anyone has more time on their hands and feels like being able to do a better job fixing this lib, you are welcomed to commit.

Harry.

OK, so I added the functionality for internal oscillator. I would still recommend against using it, but here you go:
bool capOk = capsense.begin(0x3, 0x4, 0x5, false); //setup first two channels, autoscan with 2 channels, deglitch at 10MHz, use external oscillator
^- change false to true and that's all you need.

I do not know where did you get the idea that connecting CLK input pin to GND would eenable internal oscillator, as not only datasheet but also my comments in the library C file clearly state that you must set specific configuration bit to do so.

Anyway - here you go, tested, working, have fun.

@C-monC - let that line alone, Wire.setClock(400000L) sets the Arduino I2C clock frequency and has nothing to do with the sensor chip oscillator frequency.

Hello!
Has anyone managed to wake up reading the channels?

And to use this sensor in arduino is it necessary to "remove" the part of the processor that comes in it?

By the way, I found that it is no need to add I2C level shifter since some of the Arduino board can accept the 3.3V digital signal.

Did you directly connect the Arduino SDA and SCl in the SDA and SCL of the FDC2214 board?