Simulated Keyboard and Mouse Design Based on CH551/CH552G
Preface
This month I suddenly had the idea to make a keyboard and mouse simulator, so I went to the familiar WCH website and found the CH552G and CH340K.
Without further ado, let's get started. (At this time I didn't realize I was stepping into a big pit, because there's already a ready-made CH9326 chip)
Schematic Design & PCB Design
First, let's look at the schematic:
The overall idea is to use CH340K as a USB-to-serial converter to connect with CH552, where CH552 emulates an HID device and sends HID packets to the controlled host according to commands received on serial port 0, completing the simulated operations.
In the diagram, I connected the serial port RTS and DTR to the interrupt pins of CH552 for flow control. SRV05 is an ESD protection chip. (Why did I only think about this when winter came...)
As for the PCB, I quickly drew a two-layer board and sent it to JLC for prototyping. (Then I got into trouble soldering the MicroUSB connector)