专业版
#第七届立创电赛#基于N32G430C8L7制作的USB电流表

创建时间:2年前

3458 7

描述

<div class="document"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;"> 1、项目功能介绍</span></h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;">基于N32G430C8L7+INA199制作的USB电流表</span><br><span style="color:#000000;">输入电压:5~24V</span><br><span style="color:#000000;">功能:1.电压、电流、功率、电量循环显示;2.pd诱骗;3.读取滑动变阻器阻值进行pwm调压调流</span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;">2、硬件部分</span></h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;"><span style="font-size:14px;">主控芯片:国民技术N32G430C8L7</span></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:14px;">电源芯片:BL9342</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:14px;">电流采样芯片:INA99</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:14px;">PD诱骗芯片:CH224K</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:14px;">电流控制:PC817C+NCE30H10K</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:14px;">电流旁路:短接bypass端子(屏幕下reset右侧端子),可跳过PWM回路(仅做电压电流表时短接)</span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;">3、软件部分</span></h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">基础程序为本次活动提供的演示程序,修改增加电量循环显示与PWM调制部分,具体详见程序附件。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#e03e2d;">9月4日更新:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#e03e2d;">1.更改AD采样为多通道DMA自动循环模式;</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#e03e2d;">2.删除所有delay函数,主程序全速运行。采样、显示全部改为定时中断:电压、电流采取主程序累加,中断程序每0.5秒求平均的方式增加采样频率;电量(mAh)0.5秒累加一次;显示2秒更改一次;电位器采样放在主程序全速运行,修正原来调整PWM延迟问题;</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#e03e2d;">3.定时中断、pwm、ADC_DMA全部单独编写库文件,方便查看修改;</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#e03e2d;">4.顺便点了个灯,板上led以1秒为周期闪烁。</span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">4、一点关于编程的吐槽</h3> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;">我以前没学过stm32,看到立创说的0基础,想着顺便学学stm32的心态就报名了。谁知看了教学视频才发现,立创0基础,永远是骗人的T_T。没办法,已经上了贼船了,硬着头皮也得上啊。于是上网到处找stm32的教程,最后选择了bilibili上江科大自化协的入门教程(0基础的同学真心建议看看这个教程,讲的真的很好)。认真看了几集,觉得有点入门了,于是下了国民技术的资料包开始研究,结果发现国民技术的函数和stm32的不兼容!!!而国民技术的资料除了一个用户手册和数据手册以外连个函数说明都没有!!没办法,又只好对照例程还有库函数名,连蒙带猜往下编。我硬件PWM引脚是PA15,当时看手册对应的TIM2的CH1通道,但是怎么对照例程设置都无法输出,最后没办法在群里请教了国民技术的李老师,根据李老师指点发现原来里面有个参数,例程里所有pwm通道用的都是GPIO_AF3_TIM2,但偏偏PA15要用GPIO_AF6_TIM2。。。。通篇例程、库函数注释、手册里都没有说过。。。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;">所以也想给国民技术提点建议:能不能增加个函数手册,或者把例程和库函数的注释再写的全面点?门槛低一点,产品推广起来也会更顺利些,不是吗?</span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">5、大赛logo</h3> <p><img src="//image.lceda.cn/pullimage/UNYtzUTi5UXXOFat17HP13ANiGiwkhdnqoa9U52y.jpeg" alt="" width="1200" height="1200"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/HZJz8bIN0xCF2BtHojgIc0U73L21NK0hcGrKV5lF.jpeg" alt="" width="1200" height="1200"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/KjDpLZfq0kOVdBTpHrRTxJc7Irt2HPH9REinPjzb.jpeg" alt="" width="1200" height="1200"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> </div>

文档

BOM

暂无

附件

附件名 下载
0b6d78381660a2f6a7231dc23018a678.mp4
305631044e0b0dcb2cfed8df4dff065.jpg
f1da109cd292be098e04824dd2b1d52.jpg
3e9f1618cbc7e0eb1604cac8f35f343.jpg
AD_PWM_TIM2(9月4日修改工程).zip

评论(0)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow