专业版
#第七届立创电赛#USB电流电压表

创建时间:2年前

描述

<div class="document"> <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;">1、项目功能介绍</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;">基于N32G430C8L7+INA199制作的USB电流表,精度1%,可以查看USB工作时候的电流电压和功率,支持切换多种查看模式,支持快充(5.2V-24V)。</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;">2、项目属性</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;">项目设计参考了训练营官方案例,扩展了一些功能,软件部分重新编写。</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;">3、开源协议</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;">本项目硬件设计和软件代码全部开源,其中用到其他项目的代码,保留了原协议说明。</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;">4、硬件部分</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;">项目设计使用了立创EDA专业版,参考了训练营官方案例快充版,做了一些修改。</p> <ul><li 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="font-size:14px;">Boot和Reset采用实体按键,另外增加3个按键,用于交互操作</span></li> <li 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="font-size:14px;">显示屏采用TFT LCD 128x160,SPI接口通信</span></li> <li 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="font-size:14px;">增加Type-C输入接口</span></li> </ul><p><span style="font-size:14px;"><img src="//image.lceda.cn/pullimage/qeGL3gNa5O0JtDp1Jm2rt4wXTrQuiuXsC1Ppvn6d.jpeg" alt="" width="1200" height="1080"></span></p> <h3><span style="font-size:14px;">烧录和调试</span></h3> <p><span style="font-size:14px;">引出了SWD和UART接口,烧录使用了PowerWriter PWLINK2 Lite(9.9元包邮),同时支持查看串口输入输出,使用方便,不熟悉的可以直接查看<a href="https://docs.powerwriter.com/docs/powerwriter_for_arm/start/online/data" target="_blank">官方说明文档</a>,非常详细。</span></p> <p><span style="font-size:14px;"><img src="//image.lceda.cn/pullimage/LMe8irnfrRaVI6Fge8GrV3QBTYo96ahkvNqbN6xz.png" alt="LMe8irnfrRaVI6Fge8GrV3QBTYo96ahkvNqbN6xz.png"></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;"><img src="//image.lceda.cn/pullimage/ywkMyICAm2r8v2wulqeMOZmYfipQMGTk7ELp7w7K.png" alt="ywkMyICAm2r8v2wulqeMOZmYfipQMGTk7ELp7w7K.png"></p> <h4 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;">DCDC</h4> <p>项目参考官方案例,使用DCDC降压,官方案例标明支持4V-24V,实际测试发现输入5V时,输出只有2.6V,不能驱动单片机和显示屏幕正常工作,查看数据手册发现支持(6V-24V)。实际测试发现<strong><span style="color:#e03e2d;">输入5.2V</span></strong>输出3.3V,可以正常工作,用手机充电器最高测试了<strong><span style="color:#e03e2d;">输入9V</span></strong>正常工作,由于没有相关设备,更高的电压范围暂未测试。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" 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;">5、软件部分</h3> <hr class="horizontal-splitline normal-bold-2"><h5 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;">开发工具和环境配置</h5> <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;">软件使用了VSCode开发,环境配置直接参考<a href="https://www.nationstech.com/zlxz369/index.html" target="_blank">国民技术官方文档《N32G430系列GCC开发环境应用笔记》</a>,实际只需要安装arm-gcc编译器和make工具即可。</p> <h5 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;">源码结构和代码编译</h5> <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;">源码结构直接用的国民技术官方Demo修改,代码编译只需进入examples/GPIO/LedBlink/GCC目录,执行make即可,build目录保存了构建生成产物,<span style="font-size:14px;">PWLINK2 Lite烧录时,选择output.bin文件即可。</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="font-size:14px;"><img src="//image.lceda.cn/pullimage/USZ705CXFuF6etzgsQajoPVLNqijudK2Dg9R4f56.png" width="208" height="433" alt="USZ705CXFuF6etzgsQajoPVLNqijudK2Dg9R4f56.png"></span></p> <h5 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="font-size:14px;">源码介绍</span></h5> <ul><li 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="font-size:14px;">显示模块移植了显示芯片ST7735的驱动程序,使用SPI接口通信,代码中实现了硬件SPI和软件SPI,都已调试通过。</span></li> <li 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="font-size:14px;">尝试移植LVGL,想做一些便捷的交互,设计的3个按键就是想适配LVGL编码器操作。但是由于N32G430C8L7的ROM只有64KB,在对LVGL做了极致裁剪,只保留核心模块的情况下,编译出来的程序还是超过20几KB,遂放弃LVGL。</span></li> <li 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="font-size:14px;">虽然没法使用LVGL,还是用封装的画图函数,实现了两种显示模式。</span></li> </ul><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="font-size:14px;">实时图</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="font-size:14px;"><img src="//image.lceda.cn/pullimage/9DSBIkDw65c4S1BXkhxu7aZHCSq78QkzhNUuyluo.jpeg" alt="" width="1088" height="712"></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;">数值</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/uHnjdXmzMEh5rpnhiD3CvT7wv9SzQihUVmtZldx0.jpeg" alt="" width="1200" height="899"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" 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;">6、BOM清单</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;">参见BOM</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;">7、大赛LOGO验证</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;"><img src="//image.lceda.cn/pullimage/5U4u8IIu6Rrt6j6okUPx1nArMaYwL9kB9tF5bOg4.jpeg" alt="" width="1200" height="1042"></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/S83FZzxx28FzX2BPwfJS3dAgrD0dZd70HkBK7cvE.jpeg" alt="" width="1200" height="760"></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;">8、演示您的项目并录制成视频上传</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;"> </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

暂无

附件

附件名 下载
demo.mp4
usb-meter-src.zip

成员

评论(5)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
PATRIOT 回复
<p>大佬,原理图中的采样电阻精度要求多少??</p>
ccdd11 回复
<p>@PATRIOT 1% 买的这个 <a href="https://item.szlcsc.com/240706.html" target="_blank">https://item.szlcsc.com/240706.html</a></p>
zhss25800 回复
<p>上传个固件吧?小白不懂[emojis:抱拳]</p>
YING 回复
<p>代码不对应吧?</p>
YING 回复
<p>在led示例工程中</p>
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