CapSense API - which function I have to use to change the baseline value?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I would like to change the baseline value using the API CapSense_SetBaselineData, but, after the CapSenseFilters_RunAdvancedLowPass I noticed that the baseline is changed to the Rawdata value.

Can someone give a direction for that?

0 Likes
2 Replies
Anonymous
Not applicable

Are you using CapSense v2.40 and ALP filter?

When you call the CapSenseFilters_RunAdvancedLowPass for the first time, the ALP filter initializes the baseline to Median+Average filtered value. The median+Average filtered data will be same as the first raw count sample.

After this, the ALP filter never updates the baseline. It only updates the raw count data.

Are you seeing any issues with the baseline initialization? Could you please let us know what behavior your are expecting?

0 Likes
Anonymous
Not applicable

> Are you using CapSense v2.40 and ALP filter?

I'm using the CapSense v2.60 + ALP filter.

Thank you for the explanation about the behavior of the filter and baseline.

> Are you seeing any issues with the baseline initialization?

No. 


> Could you please let us know what behavior your are expecting?

I'm working in a application where I have two sensors: a capacitive sensor and another, optical, with I2C communication. The equipment is USB powered and have a coin cell to remain the PSoC powered in case of a USB disconnection.

The problem that I'm trying to solve is the USB cable monitoring. If the USB cable is disconnected, the PSoC have to enter in sleep mode and should to wake-up by WDT event and, if the USB cable is connected, the PSoC remains in active mode.

This is working very well. The problem is that the communication with the optical sensor is lost when the USB cable is removed. After the connection, the I2C function xI2C_VL6180_I2CMasterStatus never returns and my application never return to the operation. The unique form that I found to solve this problem is restarting the PSoC. This solution give me another problem: I can't that the baseline value is reloaded after the reset. I want that the baseline remains the value that it has before the reset.

To try to solve this, I did the follow:

- when the USB cable was removed, I save the baseline value into the flash memory;

- after the USB cable reconnection is detected, I get the value from memory and assign this value to baseline.

After that, the filter acts and I lost the baseline value...

Well.
I started this development from some examples of using the Capsense from Cypress. I already thinking in remove the filters and perform some tests. Or... Based on your description of the behavior of the ALP filters, I think that I can update the baseline value after the first execution of the CapSenseFilters_RunAdvancedLowPass API.

many thanks,

best regards!

Rafael Dias

0 Likes