You are here

CY8CMBR3116 raw count hops | Cypress Semiconductor

CY8CMBR3116 raw count hops

Summary: 4 Replies, Latest post by flemming_1531576 on 04 Feb 2016 11:44 AM PST
Verified Answers: 2
Last post
Log in to post new comments.
flemming_1531576's picture
3 posts


I use a CY8CMBR3116 for capacitive level sensing, using raw counts from all 16 channels. It is a custom HW design, supply decoupling follows the datasheet Figure 13. All 16 CSxx inputs are wired through 470R resistors to PCB pads.

Generally the raw counts are stable but occasionally, after booting, one or two raw count values are offset by about +/- 150 counts, without any physical change. This offset stays until next power cycle.

Attached please see a raw count plot, acquired over 50 power cycles ~5 sec each, with no physical change during that time.

Note how CS05 reads ~1465 after power cycle 7,9,18 and 27, only to return to the normal ~1648 again. I have seen this behavior on other channels as well, one or two at the time.

Since I'm sensing absolute levels, these jumps are detrimental to the application, and I am looking for information on how to avoid them.

Best regards

Flemming Nyboe


The sequence for each cycle is:

1) VDD = 3.3V

2) Wait 1200 ms

3) Self diagnostics check, reading TOTAL_WORKING_SNS (OK in all cases)

4) Read 16 raw count values, repeated 10 times. Details:

  4.1) Write SENSOR_ID value

  4.2) Wait 8 ms

  4.3) Read 13 bytes from SYNC_COUNTER1 up to and including SYNC_COUNTER2

  4.4) Check for sync counter match and DEBUG_SENSOR_ID match.

  4.4.1) If fail wait 4 ms, then goto 4.3

  4.4.2) If success then goto 4.1 (next sensor ID)

5) VDD = 0V

6) Wait 800ms, then goto 1)

I.e. the sequence is similar to the one used by the EZClick board


Relevant device configuration:


SPO_CFG 0x10







Prem Sai's picture
Cypress Employee
13 posts

Hi Flemming,


The below could be a cause for the issue you are observing:

The MBR3 devices use the "SmartSense" algorithm(Auto-tuning) that automatically tunes the internal hardware parameters based on the parasitic capacitance seen on the board, and the required sensitivity level. The aim of the tuning process is to bring raw counts into an approximate range (about 70% of full-scale rawcounts), since that range gives optimum performance (for detecting a change in capacitance).

However, when the parasitic capacitance is at some border value between 2 tuning parameter options that the device can choose, then there is a possibility that the device may tune to different values after each reset.


An example illustrating this is below: 

If the parasitic capacitance is 10-12 pF, then an internal hardware parameter(say IDAC value) is N. 

If the parasitic capacitance is 12-14 pF, then the internal hardware parameter is made "N+1".

Now, if the parasitic capacitance on the board is close to the border, ie, 12 pF, then it could be that the tuning parameter could get set either way (N or N+1) depending on the slight noise. Since the tuning process happens when the device boots up after a reset, this can result in a different raw count value during each boot up.

However, this varying baseline during boot-up does not affect the functionality of the device(which is to detect sudden changes in capacitance as finger touches), since it needs only to measure a sudden change in rawcounts, and not absolute value of rawcounts.


References: Page 16 of MBR3 design Guide:

Getting Started with Capsense(AN64846):


If you use a programmable device such as PSoC4000, then you can use manual tuning (instead of Auto-tuning), and that can help in avoiding such abrupt changes that occur due to tuning.

In this MBR3 device also, can you try to decrease the sensitivity to lesser values (if the present value is more than 0.4 pF sensitivity, you can reduce it towards 0.4 pF sensitivity) as this might give a lesser probability of the border-capacitance occurrences. However, it may not guarantee against the issue completely. So, it would be preferable to use a PSoC4000.


Another point: Can you please let us know more about your application, and why the "absolute" rawcounts is required ?

Note that even with after manual tuning(with PSoC4000), the absolute value of rawcounts may not stay same, because the environmental parameters such as temperature have a significant impact on the capacitance of a sensor, and can cause it to drift( though it would be smoother drift unlike the abrupt rawcount shifts seen in your graph). 

So, for applications that need an absolute raw count value (such as liquid level sensing), you may require to have a "reference sensor" that would face the same environmental changes as the actual sensor, so that you can compare rawcounts against the reference to decide if the actual sensor is activated. You may find a discussion of this in this article:


Thanks & Regards,

Prem Sai

flemming_1531576's picture
3 posts

Hello Prem Sai,

Thank you for your detailed answer, this is very helpful, especially how PSoC4000 would allow manual tuning.

I now understand how SmartSense auto-ranging can cause changes in raw counts. I did not anticipate this happening, because the CapSense CSD Plus output range is 16 bits, so my readings in the 1500-1600d range are below 3% of full scale (far from 70%).

I also understand that jumps raw counts at power-up do not affect the intended use of CapSense for touch detection.

My application is similar to the liquid level detection described in the EETimes aticle you link to. We need to detect a static level at power-up, which is why power-up raw counts are relevant. I understand the principle of a reference electrode, and could implement something similar. However, I don't see how this would help the specific issue, since the jumps in raw count I observe, are on individual sensor channels - so if raw count of one level sensor changes due to SmartSense power-up tuning, this may or may not also apply to the reference sensor, correct?

Best regards,

Flemming Nyboe

Prem Sai's picture
Cypress Employee
13 posts

Hi Flemming,

The resolution (16-bit or 12-bit, 11-bit  etc) is also decided during the Smartsense auto-tuning process and based on the sensitivity settings in MBR3. In this case, the resolution might have been set to 11-bit, and hence the raw-count value you are observing.

As you said, then the reference sensor would not help on the issue of abrupt jumping of raw-counts after each reset/boot-up

Manual-tuning with a programmable device like PSoC4000 is required for avoiding this abrupt jumping, because in manual tuning, you set all the capsense hardware tuning parameters yourself and the device does not decide anything.

The reference sensor is suggested in addition to manual tuning to compensate for environmental effects on capacitance - for applications that require absolute raw-counts such as liquid-level sensing.

We believe this query is also being addressed on a Cypress case.


Thanks & Regards,

Prem Sai

flemming_1531576's picture
3 posts

Hello Prem,

That makes sense, thanks again.

I will close the Cypress case.

Regards, Flemming

Log in to post new comments.