This is a simple STM32 oscilloscope built following the JLCPCB training camp
. Circuit components: 1.
STM32 minimum system, integrating CH340 serial port download and Type-C reset one-key download function;
2. A 5V negative voltage generation circuit composed of XL7660 provides the negative power supply for the amplifier;
3. Input front-end amplification is performed by TL072IDR, amplifying the input signal and outputting a follower to the ADC and frequency capture circuit;
4. Frequency calculation is performed by an LM393 voltage comparator, which the MCU counts to obtain the input frequency;
5. Peripherals include two customizable LED indicators (current-limiting resistors can be selected according to LED color to prevent excessively dim or bright LEDs); three function buttons (PWM switch, duty cycle, frequency);
a rotary encoder (for waveform amplification and pause); and a PWM output interface;
6. Output display uses a 1.8-inch TFT full-color screen;
7. Includes an AC/DC coupling switch and an X1 and X50 multiplier switch, with multiplier switching obtained by resistor voltage division.
8. The circuit is powered by a 5V Type-C input, and the AMS1117-3V3 powers the MCU.
II. Code Section:
Based on the official example code, the hardware has been ported.
1. The ADC converts and prints the waveform point position. The external interrupt `EXTI` detects the button presses. A PWM waveform is output using the TM2 channel, and the TM3 channel captures the input frequency to obtain the frequency of the input waveform. (Some bugs in the code have not been fixed.)
2. Integrated CH340N serial port download, providing one-click Type-C serial port download and SWD download modes, which is convenient and fast. Only a Type-C cable capable of transmitting data is needed to download the program. (Compiled using KEIL5 MDK; FlyMCU is recommended for serial port download.)
3. Added a PWM output indicator LED, and another user-customizable one.
III. Shell:
A simple shell was made using SW (Steel Works) for easy one-handed grip, greatly improving portability. The grooved back reduces printing filament consumption and increases heat dissipation. The printing from JLCPCB is quite good. If the screws are not secure enough, a small amount of solder can be applied to the PCB positioning holes, and M2 screws can be used for fixing.
IV. Physical Product Demonstration: