## 1. Project function introduction
Participate in the training camp to make a USB ammeter.
Use N32G430C8L7+INA199 to make it.
## 2. Project properties
Used to learn the national technology N32G430 chip, use INA199 to monitor the type-c output current, and count the power.
* 0.96-inch OLED screen
* Type-C input and output, one Type-A output
* One WS2812 RGB LED
* Two IIC 1mm 4p interfaces, compatible with STEMMA sensor peripherals
* One for PWM output interface, using PB1 pin
* Onboard W25Q64JVSSIQ Flash
* Use toggle switch to control menu
* Pin header leads to SPI2 hardware interface
## 3. Open source agreement
GPL 3.0
## 4. Hardware part
### The main control
N32G430C8L7 microcontroller product adopts a high-performance 32-bit ARM Cortex™-M4F core, integrated floating-point unit (FPU) and digital signal processing (DSP), and supports parallel computing instructions. The highest operating frequency is 128MHz, integrated up to 64KB on-chip encrypted storage Flash, and supports multi-user partition permission 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 a 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 power supply
uses an LDO with a maximum input of 18V, and the theoretical maximum voltage is less than 18V.
### The maximum current of the two typecs for current sampling and USB input/output
is 5A, and the output line solder mask window treatment can be tinned according to the required current.
The current sampling part is the INA199A1DCKR current sensing amplifier, which can sense the voltage drop on the shunt resistor at a common-mode voltage of –0.3V to 26V independent of the power supply voltage.
Inserting a low-resistance detection resistor in series in the current path will form a small voltage drop, which can be amplified and thus treated as a signal proportional to the current. The low-side sampling method is used. The voltage sampling part consists of a voltage divider circuit composed of two resistors.
### Display part
The display part uses a 0.96-inch 4P OELD screen module and uses IIC communication.
## 5. Software part
### Compilation parameters
* Compiler: ARM Compiler version 5
* MDK version: 5.31
* Debugger: DAP-LINK
## 6. Actual picture
![IMG_5945.JPG]

![IMG_5952.JPG]

## 7. Competition LOGO verification
![IMG_5946.JPG]

## 8.
See the attached demonstration video