1. Introduction to project functions
It adopts a full-function type-c interface, which has functions such as data transmission while detecting power. It also supports the pd fast charging protocol, which can detect the fast charging power of devices that support the pd protocol. The data is displayed on a 0.91-inch Oled screen.
2. The project properties
are improved according to the official open source project. The change is that type-a is replaced with a full-function type-c, which supports the pd fast charging protocol.
3. Open source protocol
This project is completely open source. (This PCB is not suitable for the official example shell) The
18v to 3.3v converter uses the ams1117 regulator, which can be replaced by the DCDC circuit under the official example. The
amplification factor of the current sensing amplifier is 50V/V. If you choose other models, you need to adjust the code.
4. Hardware part
1. 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 maximum operating frequency is 128MHz, with up to 64KB of on-chip encrypted storage Flash, and supports multi-user partition authority management, and supports 16KB of embedded SRAM. It has a built-in internal high-speed AHB bus, two low-speed peripheral clock buses APB and bus matrix, supports 40 reusable I/Os, provides a rich high-performance analog interface, 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/I2S, 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. This case uses few resources, and the internal clock has been open source to meet the design requirements, so there is no need for an external clock circuit. It should be noted that each power 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.
2. The voltage conversion
uses the AMS1117 voltage regulator chip with a maximum of 18V to 3.3V, and the maximum output is 1A, which is enough for the microcontroller. And the circuit connection is relatively simple, which is suitable for the needs of this design.
3. Current sampling
The current sampling part is the INA199B1DCKR current sensing amplifier (also called current sensing amplifier), which is often used for overcurrent protection, precision current measurement for system optimization, or closed-loop feedback circuits. This series of devices can sense the voltage drop across the shunt resistor at a common mode voltage of -0.3V to 26V independent of the power supply voltage.
5. Software part The
software part is mainly the driver of ADC and OLED. The detected voltage and current values are read through ADC, and the data is displayed on the screen through OLED driver. For details, see the project attachment
6. BOM list
BOM list See attachment
* 7. Competition LOGO verification
8. Demonstrate your project and record it into a video and upload
the video See attachment