After consulting Qinheng engineers, I learned that the CH551G has been discontinued, and the CH552G that is still in production is fully compatible with the program. You can consider this when buying chips.
By the way, someone bought the CH551G without a USB boot program and reported to me that it could not be burned. Here I will directly post a link to the one I bought before that worked.
I will not vouch for the store. In Huaqiangbei Electronic City, if a store does not have this chip, it will ship the order to the stall next door. I don’t know if the chip that cannot be programmed will be sold out.
light:
button:
touch:
other:
cost:
Capacitive button position detection principle:
Although the technical document does not provide the internal circuit, I guess the principle is similar to the above. The size of the touch capacitance is detected by counting the resistance-capacitance oscillation output pulses.
Moreover, the capacitance change of the touch capacitor is proportional to the contact area, so the middle position of the press can be obtained through simple proportional calculations.
In order to enlarge the intermediate transition position, the touching copper will be made like a staggered comb, as shown in the picture below.
PS: The same principle applies to capacitive touch screens and trackpads.
For detailed recommended shapes for touch copper pouring, see the attached PDF.
Capacitive button debounce procedure:
uint touch_data[5];//读取回来的原始数据,正常工作时范围在4000~1000
uchar touch_leve[5];//滤波后的数据,保留百位数
void hysteresis()//滤除噪声
{
uchar i;
uint temp;
for(i=0;i<5;i++)
{
temp=touch_leve[i]*100;
if(touch_data[i]>temp+100)//每次才加减这一点点,动态是差点,但在90Hz采样率下这都不是什么大问题
touch_leve[i]++;
else if(touch_data[i]<temp-100)
touch_leve[i]--;
}
}
The program filtering algorithm is similar to a hysteresis comparator. It enters the next level only when it reaches a specific threshold. After entering the next level, the upper and lower trigger thresholds will also change.
In other words, it's just Schmidt's trembling.
This thing is very similar to the capacitor plate detection paper quantity that was very popular before. Interested students are recommended to check it out. I will not reinvent the wheel.
If you want the program, click on my avatar to see the <CH551G Touch DEMO> project.
Matrix key scanning principle:
This is the original circuit modified from the previous work. If you haven’t seen it, click on my profile picture to see past projects.
Note that this picture shows positive logic, and 51 is a weak pull-up output, so in actual use it is negative logic (reverse the diode).
As can be seen from the picture, in addition to the matrix buttons, there is also a row of independent buttons below, which are completely reused, but the button conflict is serious.
Except for independent buttons that can be pressed at the same time, only one of the other buttons can be pressed at a time, otherwise it will not be possible to tell which buttons are pressed.
Of course, you can add money to achieve full-key collision-free. But in the end, I still have to compromise with the cost.
If you are a little wealthy and bridge a bunch of 74HC595, the possibilities are endless, right `( >﹏< )′
PS: There is a low-end version of 595 in LCSC, which is only 1 cent each when it is not out of stock. Now it is 2 cents.
The left is the main board and the right is the base plate. Just like the previous one, we use M3 nuts to connect them. The screws do not protrude from the base plate and are not afraid of scratching the fabric.
Note that the screws are inserted under the positioning plate first and then the shaft body is welded to fix the positioning plate.
The bottom plate pattern can be changed at will, but it has no function anyway.
The USB port on the bottom panel is slotted to make the keyboard thinner.
Take a photo with the current main keyboard
cover
Operation video: https://b23.tv/f7rfO5
The video uploaded in the attachment does not look smooth, so I posted it to site B.
Burning tutorial: https://oshwhub.com/TheLight/zi-ding-yi-jian-pan
Program update log:
What was added previously is not recorded in detail. It is still undergoing functional iteration.
Ver0.4:
Ver0.41:
Ver0.42:
Ver0.421: (Customized branch)
Ver0.43:
Principle description picture reference link: https://baijiahao.baidu.com/s?id=1621173179116478690&wfr=spider&for=pc #
PDF source: Shiqiang Components, Microchip, STMicroelectronics
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet