[LiChuang Open Source] First try of the national MCU N32G430 current meter and fast charging sampling
[Copy link]
I saw a good article! Share it with everyone~
The content has been open sourced in LiChuang, open source address: https://oshwhub.com/gnosis/n32g430
The ammeter is implemented using the National Technology MCU N32G430, supporting voltage, current, power, ripple and current fluctuation graphic display.
I have just learned Keil5 to write microcontrollers, and I just implemented it according to my own ideas. The code may be imperfect, and you are welcome to point it out.
The main goal of the one I am making now is to achieve the following functions:
1. Voltage, current display, power display, this is relatively simple and has been realized ;
2. Voltage ripple display, which has also been realized ;
3. Charging protocol analysis, temporarily want to use D+D- to judge the protocol, but the actual measurement seems to be very inaccurate, I don’t know how to analyze the charging protocol specifically, and it needs to be improved ;
4. Current fluctuation graph, which has been realized ;
5. Power consumption statistics, although this function is simple, but I am not familiar with this microcontroller at present, and there are some errors in each time obtained, so it is still being optimized ;
6. Fast charging deception, the idea is to achieve it through D+D-, but later it was found that N32G430 does not have DAC function, so it is currently abandoned.
A brief description of the functions:
1. The Boot/SEL button switches different function pages. The first page is voltage and current display, the second page is voltage ripple, and the third page is current fluctuation;
2. BTN1/+, BTN2/- adjust the display range on the second and third pages, and enlarge or reduce the waveform.
If you don’t understand, you can discuss with each other. Thank you for your attention!
The finished product is also posted here. It is still relatively small, and a TYPE-C port is added, which is more convenient.
The soldered style, I wanted to take a working picture, but found that the screen flickered a lot, and the displayed content was incomplete, so I simply put it up when I recorded the video later.
Three buttons can easily realize some switching, parameter adjustment, etc.
First screen: Voltage measurement interface. The incomplete display on the picture is caused by the mobile phone's capture speed being higher than the refresh speed. This is actually normal.
Second screen: Voltage ripple interface
The third screen: current fluctuation interface
The code has also been open sourced. If you are interested, you can also go to the LiChuang open source platform to view details.
|