1309 views|1 replies

1w

Posts

16

Resources
The OP
 

[Shanghai Hangxin ACM32F070 development board evaluation] 4. LCD_TK program analysis [Copy link]

 

I ran the LCD_TK example and was shocked by its speed.

I am also a fan of dot matrix display screens. I find some menus very complicated and not very fast when searching. However, this program makes a beep when I touch it with my hand, which seems very flexible.

So I was a little interested, could something I made be so useful and lovable? So I decided to analyze it.

The program itself is not too complicated. However, it is not too complicated. I spent a lot of time looking at it and finally understood it. It is roughly as follows:

1. Cycle detection of buttons, beeping as long as a button is pressed

2. Only when the OK button is pressed will the program be set to a set state, and when the program is run in the set state, the variable is:

fu8_Work_Mode

3. Use SYSTICK interrupt to count. When a certain amount is counted, set a variable to remember the previous state. This variable is:

gu8_time_count_free

The general process is like this. What surprised me is that these buttons are capacitors, so they need to be charged and discharged.

I looked at the schematic diagram as follows:

自电容检测原理框图见结构框图章节所示。比较器负端连接到采样电容 Cs,正端连接
TKEY模块的参考电压VREF输出。每个TKSCLK周期,通过对SW1和SW2的控制,OPA/LDO
输出的充电电压 VKEY 会先给外置通道按键分布电容 Cx 充电,然后 Cx 给 Cs 充电,一般情
况下 Cx(pF 级)的值远小于 Cs(nF 级)。经过多次充放电后 Cs 两端电压超过参考电压 VREF
时,比较器输出翻转;由一个计数器对 Cx 向 Cs 充电的次数(从单个通道扫描开始到比较器
输出翻转)进行计数,得到单次扫描的计数值。当手指和触摸按键靠近时,会引起 Cx 值发生
变化,扫描的计数值就会发生变化。通过计数值的变化可以测量出 Cx 上电容的变化,从而达
到触摸检测的目的。另外,电路上除了外置的 Cx 通道,还有一个内置扫描通道连接到补偿电
容 Cr,Cr 可以用于测量 Cs,在 Cx 电容小于 10pF 时,也可以通过使能 Cr 进行补偿;还有用
于防水控制和增加检测灵敏度的 Cshield 屏蔽通道。
一个通道扫描控制流程如下:
 使能检测通道,闭合 SWCX[n](正常模式)或 SWCR(内置通道);
 SW1,SW2 断开,SWCS 闭合,使得 Cs 对地放电;
 SW1,SW2,SWCS 断开,计数器清零;
 SW1 闭合,SW2 断开,OPA/LDO 给 Cx 充电;
 SW1 断开,SW2 闭合,Cx 给 Cs 充电,计数器加 1;
 重复上两个步骤直到 Cs 电压超过 VREF;
 比较器输出翻转,计数器结果锁存,并通过总线交给软件处理。

The development board has six buttons, each for one channel. I pressed each one very quickly but the development board responded accurately, which I found a bit incredible.

That is to say, every time I press it, the capacitor unit inside has been charged and discharged countless times.

This post is from Domestic Chip Exchange

Latest reply

The development board has six buttons, each for one channel. I pressed each one very quickly but the development board responded accurately, which I found a bit incredible. That is to say, every time I press it, the capacitor unit inside has been charged and discharged countless times. This board is really good!   Details Published on 2022-10-2 08:21
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 
 

6841

Posts

11

Resources
2
 

The development board has six buttons, each for one channel. I pressed each one very quickly but the development board responded accurately, which I found a bit incredible.

That is to say, every time I press it, the capacitor unit inside has been charged and discharged countless times.

This board is really good!

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list