本文介绍了如何利用简单的电容触摸按键电路配合MCU软件处理实现准确的键码判码。针对电容按键信号的高灵敏度和易受干扰以及容易随环境变化产生漂移的特点,重点从软件方面分析了如何实现去除按键输入信号干扰的滤波算法以及有效地解决了输入按键信号的漂移问题。该方法的硬件电路非常简单,由于MCU固件容量不大、占用处理器资源少和采用分时处理手段,用于电路管理和控制的MCU可以同时用于按键信号处理,有利于提高产品的性价比。%The article introduced how to constitute a capacitor touch key with simple circuit controled by MCU and get the right key code.For a capacitor key feature of high susceptible to interference and signal floating with environmental changes,Discussing focusses on the filter arithmetic of key input signal with anti-noise property and solved the problem of the signal floating with environment changes.The circuit construction is extremely simple.The MCU firmware is compact,occupy less processor resource and adopting time-sharing processing method,The MCU also can be used to manage and control circuit.That is helpful to rise product cost performance.
展开▼