Microchip
直播中

张海宝

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

是否有人使用PIC12LF1552文档中的示例代码来实现触摸传感器?

是否有人使用PIC12LF1552文档中的示例代码(示例16-1)来实现触摸传感器?我想我理解代码以及它在做什么,我只是不知道如何处理这两个结果来确定是否发生了触摸事件。关键是使用一个内置有硬件CVD的芯片,这样我就不用使用庞大的、不可理解的mtouch框架,它需要一个C编译器。我不会阅读或理解C,所以希望使用汇编或伪代码。更具体地说,从描述上我不确定如何使用这两个结果。引自第16.1.6节“在双重转换之前设置ADIPEN位将允许用户通过从双重转换中减去结果来执行伪差分CVD测量。这是高度推荐的噪声免疫目的。“我对“减去结果”在这里意味着什么相当模糊,但我想它意味着从另一个减去。如果我这样做,它代表什么?我假设这个结果将与先前的结果进行比较。给予三角洲。只是一个假设,因为从来没有说过我能找到。什么三角洲将构成实际事件与漂移或噪音?从文件中我不清楚。此外,我假设人们会从发布中获得一个增量,必须从新闻界加以区分,以免触发额外的结果。因此,无论是积极的还是消极的三角洲都应该被视为新闻界(不知道是哪个)。我并不反对一些实验,但是有太多的变量来确保对实验结果的正确解释。我希望有人有这部分工作,而不是我猜测。(而不是我试着去破译“mTouch”框架中庞大的一堆C。)或者,如果有人能使用内置在芯片中的硬件CVD给我指出一些实际的工作代码,我会很感激的。仍然没有结果。如果我无法在官方微芯片论坛上得到帮助,我不得不想知道为什么微芯片已经生产了30个内置CVD的微控制器,而不是一个完整的工作代码示例。

以上来自于百度翻译


      以下为原文

    Has anyone used the example code , example 16-1 in the PIC12LF1552 document, to implement a touch sensor? I think I understand the code and what it is doing, I just don't know what to do with the two results to determine if a touch event occurred. The whole point is to use a chip with hardware CVD built in so I don't have to use the giant, incomprehensible mtouch framework, which requires a C compiler. I don't read or understand C, so assembly or pseudo code would be appreciated.

To be more specific, I wasn't sure from the description how to use the two results.
Quoting from section 16.1.6
"Setting the ADIPEN bit prior to a double conversion will allow the user to perform a pseudo-differential CVD measurement by subtracting the results from the double conversion. This is highly recommended for noise immunity purposes."

I'm pretty hazy on what "subtracting the results" means here, but I assume it means subtract one from the other. And if I do so, what does it represent?

I'm making the assumption that this result would then be compared to a previous result. Giving a delta. Only an assumption since it is never stated that I can find.

What delta would constitute an actual event versus drift or noise? It's not clear to me from the documentation.

Also, I assume that one would get a delta from the release, which must be discriminated from the press so as not to trigger an extra result. So either only a positive or only a negative delta should be considered a press (no idea which).

I'm not opposed to some experimentation, but there are too many variables to insure correct interpretation of the experimentation results.


I was hoping someone had this part working rather than me guessing. (And rather than me trying to decipher the giant pile of C that is the "mTouch" framework.)
Alternately, if anyone can just point me at some actual working code using the hardware CVD built into this chip I would appreciate it.

Note:  I made this same appeal on another board a year and a half ago, and still no results.  If I can't get help here on the official Microchip forum, I have to wonder why Microchip has produced 30 different microcontrollers with built-in CVD and not one complete example of working code.

回帖(1)

李兵

2019-5-23 06:55:32
CVD上有一个应用说明,很好地解释了差分电容模式的工作原理:http://ww1.micro..com/...en/appnotes/01478b.pdf

以上来自于百度翻译


      以下为原文

    there is an application note on CVD that explains quite well how the differential capacitive mode works:
 
http://ww1.microchip.com/...en/appnotes/01478b.pdf
 
举报

更多回帖

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