1. Project function introduction
USB ammeter based on N32G430C8L7+INA199 Input voltage: 5~24V Function: 1. Voltage, current, power, power cycle display; 2. PD deception; 3. Read the resistance value of the sliding rheostat for PWM voltage and current regulation
2. Hardware part Main
control chip: National Technology N32G430C8L7
Power chip: BL9342
Current sampling chip: INA99 PD deception chip: CH224K Current control: PC817C+NCE30H10K 3. Software part The basic program is the demonstration program provided for this event, modified to add power cycle display and PWM modulation parts, see the program attachment for details. 4. A little complaint about programming I have never learned
stm32 before, and when I saw that LiChuang said that it had zero foundation, I signed up with the mentality of learning stm32 by the way. Who knew that after watching the teaching video, I found that LiChuang had zero foundation and was always a liar T_T. There is no other way. I have already boarded the pirate ship, so I have to bite the bullet and get on. So I searched everywhere on the Internet for tutorials on stm32, and finally chose the introductory tutorial of the Association of Automation of Jiangnan University of Science and Technology on bilibili (Students with no basic knowledge are sincerely recommended to take a look at this tutorial, which is really well explained). After watching a few episodes carefully, I felt that I had gotten a little bit of an introduction, so I downloaded the data package of National Technology and started to study it. As a result, I found that the functions of National Technology were incompatible with those of stm32! ! ! And the data of National Technology did not even have a function description except for a user manual and a data manual! ! There was no other way, so I had to compare the routines and library function names, and compile them by guessing. My hardware PWM pin is PA15. At that time, I looked at the manual and it corresponded to the CH1 channel of TIM2, but no matter how I compared the routine settings, I could not output it. Finally, I had no choice but to ask Mr. Li of National Technology in the group. According to Mr. Li’s instructions, I found that there was a parameter in it. All PWM channels in the routines use GPIO_AF3_TIM2, but PA15 needs to use GPIO_AF6_TIM2. . . . It is not mentioned in the routines, library function comments, and manuals. So I would like to give some suggestions to National Technology: Can you add a function manual, or make the comments of routines and library functions more comprehensive? If the threshold is lower, the product promotion will be smoother, right?