Cypress技术论坛
直播中

李维兴

7年用户 204经验值
私信 关注
[问答]

CapSense API必须使用哪个函数来更改基线值?

我想使用API CAPENSESEJSETBASELLIEDATA改变基线值,但是,在CAPSENSEFILTSESRunAdvAccess低通之后,我注意到基线被改变为RAWDATA值。
有人能给出方向吗?

以上来自于百度翻译


     以下为原文
  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?

回帖(2)

罗红

2018-12-3 11:46:27
你使用的是CasFoSE V2.40和ALP过滤器吗?
当您第一次调用CAPSENSEFILTRESYRunAdvAccess低通时,ALP过滤器将基线初始化为中值+平均过滤值。中值+平均滤波数据将与第一原始计数样本相同。
此后,ALP滤波器永远不会更新基线。它只更新原始计数数据。
你看到基线初始化有什么问题吗?你能告诉我们你期望什么样的行为吗?

以上来自于百度翻译


     以下为原文
  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?
 
 
举报

李维兴

2018-12-3 11:55:19
引用: 小蜜蜂12346 发表于 2018-12-3 08:14
你使用的是CasFoSE V2.40和ALP过滤器吗?
当您第一次调用CAPSENSEFILTRESYRunAdvAccess低通时,ALP过滤器将基线初始化为中值+平均过滤值。中值+平均滤波数据将与第一原始计数样本相同。
此后,ALP滤波器永远不会更新基线。它只更新原始计数数据。

你使用CAPSENSE V2.40和ALP过滤器吗?
我使用的是CasFoSE V2.60+ALP过滤器。
感谢您对过滤器和基线行为的解释。
你看到基线初始化有什么问题吗?
不。
你能告诉我们你在期待什么样的行为吗?
我在一个应用中工作,我有两个传感器:一个电容传感器和另一个,光学,与I2C通信。该设备是USB供电,并有一个硬币电池保持PSoC供电的情况下,USB断开。
我试图解决的问题是USB电缆监控。如果USB电缆断开,PSoC必须进入休眠模式,并且应该通过WDT事件唤醒,并且如果USB电缆被连接,PSoC保持处于活动模式。
这很好用。问题是,当USB电缆被移除时,与光学传感器的通信丢失。在连接之后,I2C函数X2CYVL6180II2CMASTYSTATE永远不会返回,并且我的应用程序永远不会返回操作。我发现解决这个问题的唯一形式是重新启动PSoC。这个解决方案给了我另一个问题:我不能在复位后重新加载基线值。我希望基线仍然是重置前的值。
为了解决这个问题,我做了如下:
-当USB电缆被移除时,我将基线值保存到闪存中;
-在检测到USB电缆重新连接后,从内存中获取值并将该值分配到基线。
之后,过滤器的作用和我失去了基线值…
好。我从CyPress使用CopSoad的一些例子开始了这一发展。我已经在考虑删除过滤器和执行一些测试。或者…基于您对ALP过滤器的行为的描述,我认为在第一次执行CAPENSEFILTESSIN ReaveAdvestDebug API之后,我可以更新基线值。
多谢,
最好的问候!
拉斐尔·迪亚斯

以上来自于百度翻译


     以下为原文
  > 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
举报

更多回帖

发帖
×
20
完善资料,
赚取积分