Point Crystal – Portable Multifunctional Test Pen Design Based on CW32F030
I. Circuit Design
1. Charge/Discharge Management
In the charging IC section, I chose the commonly used TP4057 as the main controller, and the power input uses the most common Type-C interface.
In the circuit diagram, you can see that CC1 and CC2 of the Type-C interface are connected to 5.1K pull-down resistors to ground. This is to ensure that the charger accurately identifies the device when using the CC line. If using the AC line, resistors R2 and R3 do not need to be soldered.

2. System Power-On and Power-Off Control Logic
In the above diagram, the left side is the power control section, the middle button is the power acquisition section, and the right side is a five-way joystick switch, with the middle button being the power button.

II. Main Control Section
In terms of I/O configuration, priority is given to allocating pins that require dedicated functions, such as ADC, SPI, TIMER, serial port, etc., and then optimization and adjustment are made according to the layout and routing.



III. User Input

IV. Display Screen
This project uses a 0.96-inch TFT display screen with a resolution of 80*160. It employs an ST7735 display driver chip and is connected to the PCB via FPC soldering, communicating through an SPI interface.


The display screen's performance is shown in the image above.
V. Analog Front End The
analog front end is the analog circuit preceding the digital circuit. By definition, AFE (Analog Front End) processes the analog signal from the signal source and digitizes it. Its main functions include: signal amplification, frequency conversion, modulation, demodulation, adjacent channel processing, level adjustment and control, and mixing.


VI. Bluetooth Module
In chip selection, I chose the KT6368A, a BLE/SPP dual-mode chip based on the JL AC6368A. This chip supports Bluetooth 5.1, and more importantly, it does not require a start-up capacitor when using a crystal oscillator. Other peripheral circuits are also extremely simple, helping to save valuable space on a crowded PCB.

VII. Signal Input Circuit
The diagram above shows the most basic signal input circuit. First, a bidirectional TVS diode protects the subsequent circuitry. Then, analog switch 3 (COM3 and NC3, NO3) allows selection between signal input and output modes (default output mode). Analog switch 2 allows selection of whether the input signal is attenuated. The analog front-end design references an oscilloscope, with an input impedance of 1MΩ. Like an oscilloscope, it allows selection of X1 and X10 ranges, with X10 selected by default. This design maximizes the safety of the subsequent circuitry, similar to how, when storing a multimeter with a separate power button, the range should be set to "AC voltage, maximum range."

VIII. Signal Output Circuit The signal
output circuit can output DC signals or directly output PWM signals. Direct output is straightforward; it directly outputs the microcontroller's signal. DC output is achieved by adjusting the PWM duty cycle and then converting it into a "DC" signal through two stages of low-pass filtering.


IX. COM Flying Wire Notes (
Back and Front

) : 1. Make sure to solder the COM-AGND flying wire properly before use! 30AWG silicone wire is recommended, or other flying wires can be used to connect the COM and AGND pads. 2. Remember to calibrate before first use after downloading the program! 3. If used without calibration, reset the microcontroller using the reset button, then power on again to perform calibration!