* 1. Introduction to project functions
This project is based on the real-time posture display and USB current and voltage meter of the National Technology N32G430C8L7. Its functions are to display posture in real time and to measure voltage and current. It can control the status of various lights through buttons or Bluetooth to create different environments.
* 2. Introduction to the scheme
2.1 System scheme structure
The architecture of this scheme design is shown in Figure 2.1. It is mainly divided into LED light module, Bluetooth module, main controller N32G430C8L7, voltage and current sampling circuit, MPU6050 sensor, OLED display module and expansion interface, etc., aiming to learn the use of the National Technology N32G430 series.

2.2 Hardware circuit connection design
See the specific circuit and schematic design for details.
* 3. Physical picture

* 4. Hardware circuit
4.1
Power supply
According to the manual provided by the National Technology, the N32G430C8L7 main controller requires a working voltage of 2.4V to 3.6V. Therefore, the power supply part of this design provides +5V power supply through the USB port, and then uses the voltage regulator chip AMS1117-3.3V to convert the power supply voltage 5V into 3.3V voltage. SW3 is the power switch; C14 and C15 are input capacitors, which are used to filter the input power supply; C16 and C17 are output capacitors, which are used to suppress self-oscillation. LED1 is the power indicator. The circuit schematic of the power supply part is shown in the figure.

Figure 4.1.1 Power supply circuit
4.2 Main control unit
The N32G430C8L7 microcontroller product adopts a high-performance 32-bit ARM Cortex™-M4F core, integrates a floating-point unit (FPU) and digital signal processing (DSP), and supports parallel computing instructions. The highest operating frequency is 128MHz, integrates up to 64KB on-chip encrypted storage Flash, supports multi-user partition authority management, and supports 16KB embedded SRAM. It has an internal high-speed AHB bus, two low-speed peripheral clock buses APB and bus matrix, supports 40 reusable I/Os, provides a rich set of high-performance analog interfaces, including a 12-bit 4.7Msps ADC, supports 16 external input channels and 3 internal channels, and provides a variety of digital communication interfaces, including 4 U(S)ARTs, 2 I2Cs, 2 SPI/I2Ss, and 1 CAN 2.0B communication interface. The N32G430C8L7 microcontroller product can work stably in the temperature range of -40°C to +105°C, with a supply voltage of 2.4V to 3.6V, and provides a variety of power consumption modes.
The chip used in this project is N32G430C8L7. When designing the circuit, it should be noted that each power supply pin of the chip needs to be connected to an additional 100nF external filter capacitor, and the 1st pin of the chip needs to be connected to an additional 4.7uf filter capacitor. The circuit diagram is shown in the figure.

Figure 4.2.1 Main control circuit
4.3 LED module circuit
The LED module is composed of three LED lights (red, blue, green) and a current limiting resistor. The anode of the LED is connected to the pull-up resistor, and the cathode is connected to IO, which are connected to PA6, PA7, and PB1 respectively. When the IO port outputs a low level, the LED is on; when it outputs a high level, the LED is off. The circuit is shown in the figure.

Figure 4.3.1 LED module circuit
4.4 BOOT selection circuit, reset circuit, download debugging interface

circuit Figure 4.4.1 Download debugging circuit
4.5 WIFI/Bluetooth module
This project reserves a WIFI/Bluetooth interface for later development and use. The circuit diagram is shown in the figure.

Figure 4.5.1 WIFI/Bluetooth module
4.6 Button circuit
This project has three independent buttons that can be used for function selection. They are connected to PB3, PB4, and PB5 of the chip respectively. When the IO port detects that the corresponding level is low, it means that the corresponding button is pressed. Otherwise, the button is not pressed. The circuit diagram is shown in the figure.

As shown in Figure 4.6.1 Key module
4.7 8MHz crystal oscillator circuit

4.8 Voltage and current sampling circuit


*5.
Detailed software design code is attached.

*6. Problems encountered
This is my first time to participate in the training camp, and it is also my first time to weld the circuit. Therefore, I often welded it badly during the welding process. When welding the chip, it is easy to cause the solder to stick together. Later, it was used with rosin, so it was not so easy to weld it badly. Because of the use of rosin, the board did not look very beautiful.

*7. Gains
Thank you very much to Jiali Chuang and National Technology for providing me with the opportunity to participate in this summer training camp. In this process, for me, every step is a big challenge, but I have learned a lot of knowledge.
This project is my first time to participate in the training camp. Although the circuit is designed with reference to the provided case, in this process I learned how to design the voltage and current sampling circuit and some precautions for designing the circuit. At the same time, I also learned to use Jiali Chuang EDA. I also came into contact with the development project of National Technology MCU and learned some tips for welding circuits. In short, I learned a lot in this training camp. I hope there will be more such activities to participate in in the future.