描述
<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><strong><span style="font-family:'宋体';">使用国民技术</span><span style="font-family:Calibri;">N32G430C8L7</span><span style="font-family:'宋体';">芯片和采集电路制作一款双路</span><span style="font-family:Calibri;">USB</span><span style="font-family:'宋体';">功率计,可以显示当前</span><span style="font-family:Calibri;">USB</span><span style="font-family:'宋体';">的使用功率,以及支持手机快充的功率检测。</span></strong></p>
<br><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><strong><span style="font-family:'宋体';">此项目参考立创开源平台的</span><span style="font-family:Calibri;">USB</span><span style="font-family:'宋体';">功率计进行修改增加功能,未</span></strong><strong><span style="font-family:'宋体';">在其他比赛中获奖</span></strong><strong><span style="font-family:'宋体';">。</span></strong><strong> </strong></p>
<br><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><strong><span style="font-family:'宋体';">使用</span>GPL3.0<span style="font-family:'宋体';">开源协议;</span><span style="font-family:'宋体';">参考工程来源链接:</span> <span style="font-family:Calibri;">https://oshwhub.com/limengmeng12345/ji-chu-ying-usb-dian-ya-biao</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" 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"><h2><strong><span style="font-family:'宋体';">主控</span></strong></h2>
<p><strong><span style="font-family:'宋体';">使用国民技术</span><span style="font-family:Calibri;">N32G430C8L7</span><span style="font-family:'宋体';">芯片</span></strong><strong> </strong><strong><span style="font-family:'宋体';">作为主控芯片,</span></strong><strong><span style="font-family:'宋体';">需注意的是芯片的每个电源的引脚都需要额外接一个</span></strong><strong>100nF<span style="font-family:'宋体';">的外接的滤波电容</span></strong><strong><span style="font-family:'宋体';">,芯片的</span></strong><strong>1<span style="font-family:'宋体';">脚</span></strong><strong><span style="font-family:'宋体';">需要额外接</span></strong><strong>4.7uf<span style="font-family:'宋体';">的滤波电容</span></strong><strong><span style="font-family:'宋体';">。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">复位电路、</span><span style="font-family:'宋体';">BOOT电路</span></strong></h2>
<p><strong><span style="font-family:'宋体';">复位电路和</span>BOOT<span style="font-family:'宋体';">电路做</span><span style="font-family:'宋体';">了</span><span style="font-family:'宋体';">按键的设计。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">烧录接口</span></strong></h2>
<p><strong><span style="font-family:'宋体';">芯片支持多种烧录方式,如市面常见的</span>ST-Link<span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">USB-TTL</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">Jlink</span><span style="font-family:'宋体';">等烧录器。对应的接口</span><span style="font-family:'宋体';">已</span><span style="font-family:'宋体';">使用</span>2.54<span style="font-family:'宋体';">间距的排针引出作为烧录使用。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">电压转换</span></strong></h2>
<p><strong><span style="font-family:'宋体';">本次案例使用的</span>MCU<span style="font-family:'宋体';">虽然支持最大电压是</span><span style="font-family:Calibri;">5V</span><span style="font-family:'宋体';">,但考虑到了可能</span><span style="font-family:Calibri;">USB</span><span style="font-family:'宋体';">的电压或其他电压上有着不稳定的电压因素,所以使用了一个</span><span style="font-family:'宋体';">最高</span><span style="font-family:Calibri;">18</span>V<span style="font-family:'宋体';">转</span><span style="font-family:Calibri;">3.3V</span><span style="font-family:'宋体';">的</span><span style="font-family:Calibri;">LDO</span><span style="font-family:'宋体';">(</span><span style="font-family:'宋体';">所以支持快充的电压</span><span style="font-family:'宋体';">)</span><span style="font-family:'宋体';">给芯片供电使用,就算在供电不稳定的情况下,</span>MCU<span style="font-family:'宋体';">也能正常工作。需要注意的是,</span><span style="font-family:Calibri;">LDO</span><span style="font-family:'宋体';">输入和输出必须接上</span><span style="font-family:Calibri;">22uF</span><span style="font-family:'宋体';">和</span><span style="font-family:Calibri;">100nF</span><span style="font-family:'宋体';">的电容</span><span style="font-family:'宋体';">(</span><span style="font-family:'宋体';">建议电容等元器件选择耐压</span><span style="font-family:Calibri;">25V</span><span style="font-family:'宋体';">以上的</span><span style="font-family:'宋体';">)</span><span style="font-family:'宋体';">。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">电流采样、</span><span style="font-family:'宋体';">USB输入/输出</span></strong></h2>
<h3><strong><span style="font-family:'宋体';">USB输入/输出</span></strong></h3>
<p><strong>USB<span style="font-family:'宋体';">输入端使用的是一个</span><span style="font-family:Calibri;">Type-A</span><span style="font-family:'宋体';">的公头,</span><span style="font-family:Calibri;">USB</span><span style="font-family:'宋体';">输出端使用的是一个</span><span style="font-family:Calibri;">4P</span><span style="font-family:'宋体';">沉板的母座</span><span style="font-family:'宋体';">。</span></strong></p>
<h3><strong><span style="font-family:'宋体';">电流采样</span></strong></h3>
<p><strong><span style="font-family:'宋体';">电流采样部分的是</span>INA199B1DCKR<span style="font-family:'宋体';">电流感应放大器,(也称为电流传感放大器)常用于过流保护、针对系统优化的精密电流测量或闭环反馈电路。该系列器件可在独立于电源电压的</span><span style="font-family:Calibri;">–0.3V</span><span style="font-family:'宋体';">至 </span><span style="font-family:Calibri;">26V</span><span style="font-family:'宋体';">共模电压下感应分流电阻器上的电压降。共有三种固定增益可供选择:</span><span style="font-family:Calibri;">50V/V</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">100V/V</span><span style="font-family:'宋体';">和 </span><span style="font-family:Calibri;">200V/V</span><span style="font-family:'宋体';">。该系列器件采用零漂移架构,偏移较低,因此在进行电流感测时能够将分流电阻器两端的最大压降保持在最低</span><span style="font-family:Calibri;">10mV</span><span style="font-family:'宋体';">的满量程。参数如下:</span></strong></p>
<p><strong>· <span style="font-family:'宋体';">共模范围:</span><span style="font-family:Calibri;">–0.3V</span><span style="font-family:'宋体';">至</span><span style="font-family:Calibri;">26V</span></strong></p>
<p><strong>· <span style="font-family:'宋体';">偏移电压:</span><span style="font-family:Calibri;">±150μV</span><span style="font-family:'宋体';">(最大值)</span></strong></p>
<p><strong>· <span style="font-family:'宋体';">支持</span> 10mV <span style="font-family:'宋体';">满量程分流压降</span></strong></p>
<p><strong>· <span style="font-family:'宋体';">静态电流:</span>100μA<span style="font-family:'宋体';">(最大值)</span></strong></p>
<h3><strong><span style="font-family:'宋体';">采样电阻选择</span></strong></h3>
<p><strong><span style="font-family:'宋体';">在电流路径中以串联的方式插入一个低阻值的检测电阻会形成一个小的电压降,该压降可被放大从而被当作一个正比于电流的信号。然而,根据具体应用环境和检测电阻的位置,这种技术将对检测放大器造成不同的挑战。一般采样电阻的电阻值在</span>1<span style="font-family:'宋体';">欧姆以下,属于毫欧级无感应电阻,但有些电阻,有采样电压等要求,必须选择大电阻值电阻,但电阻基数大,误差大。在这种情况下,需要选择高精度的无感应电阻</span><span style="font-family:Calibri;">(</span><span style="font-family:'宋体';">可达到</span><span style="font-family:Calibri;">0.01%</span><span style="font-family:'宋体';">精度,即万分之一精度</span><span style="font-family:Calibri;">)</span><span style="font-family:'宋体';">,使取样数据非常可靠。贴片的超低电阻值电阻</span><span style="font-family:Calibri;">(0.0005</span><span style="font-family:'宋体';">欧姆、</span><span style="font-family:Calibri;">2</span><span style="font-family:'宋体';">毫欧、</span><span style="font-family:Calibri;">3</span><span style="font-family:'宋体';">毫欧、</span><span style="font-family:Calibri;">10</span><span style="font-family:'宋体';">毫欧等</span><span style="font-family:Calibri;">)</span><span style="font-family:'宋体';">、贴片合金电阻、大功率电阻</span><span style="font-family:Calibri;">(20W</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">30W</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">35W</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">50W</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">100W)</span><span style="font-family:'宋体';">等产品,温度系数为正负</span><span style="font-family:Calibri;">5PPM</span><span style="font-family:'宋体';">。</span></strong></p>
<h4><strong><span style="font-family:'宋体';">采样方式</span></strong></h4>
<p><strong>· <span style="font-family:'宋体';">此采样使用的是</span><span style="font-family:'宋体';">低边采样</span><span style="font-family:'宋体';">的方式,也就是采样电阻接在</span>GND<span style="font-family:'宋体';">的回路上,此设计可以在差分信号送入运放的时候,运算完整的差分、跟随、放大、输出。如果使用高边采样,也就是采样电阻放置在电源和负载之间的高位,虽然这种放置方式不仅消除了低边检测方案中产生的地线干扰,还能检测到电池到系统地的意外短路,但是</span><span style="font-family:'宋体';">高边检测</span><span style="font-family:'宋体';">要求检测放大器处理接近电源电压的共模电压。这种共模电压值范围很宽,从监视处理器内核电压要求的电平</span>(<span style="font-family:'宋体';">约</span><span style="font-family:Calibri;">1V)</span><span style="font-family:'宋体';">到在工业、汽车和电信应用常见的数百伏电压不等。应用案例包括典型笔记本电脑的电池电压</span><span style="font-family:Calibri;">(17</span><span style="font-family:'宋体';">到</span><span style="font-family:Calibri;">20V)</span><span style="font-family:'宋体';">,汽车应用中的</span><span style="font-family:Calibri;">12V</span><span style="font-family:'宋体';">、</span><span style="font-family:Calibri;">24V</span><span style="font-family:'宋体';">或</span><span style="font-family:Calibri;">48V</span><span style="font-family:'宋体';">电池,</span><span style="font-family:Calibri;">48V</span><span style="font-family:'宋体';">电信应用,高压电机控制应用,用于雪崩二极管和</span><span style="font-family:Calibri;">PIN</span><span style="font-family:'宋体';">二极管的电流检测以及高压</span><span style="font-family:Calibri;">LED</span><span style="font-family:'宋体';">背光灯等。因此,高边电流检测的一个重要优势,那就是检测放大器具备处理较大共模电压的能力。</span></strong><br><strong><span style="font-family:Calibri;"> </span><span style="font-family:'宋体';">所以,采样电阻加运放的电流采样方法,最好是在低端进行。虽然,低端采样,由于共地干扰的原因会影响信号的纹波情况。但是相对高端来说,</span><span style="font-family:'宋体';">方案简单易行,成本低,可靠度高。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">电压采样</span></strong></h2>
<p><strong><span style="font-family:'宋体';">电压采样部分由两颗电阻构成的分压电路组成,其原理就是电阻串联分压的知识</span><span style="font-family:'宋体';">。</span></strong></p>
<h2><strong><span style="font-family:'宋体';">显示部分</span></strong></h2>
<p><strong><span style="font-family:'宋体';">显示部分的是使用的是</span>0.9<span style="font-family:Calibri;">6</span><span style="font-family:'宋体';">寸</span>4P<span style="font-family:'宋体';">的</span><span style="font-family:'宋体';">蓝</span><span style="font-family:'宋体';">色</span>OELD<span style="font-family:'宋体';">屏幕模块,采用</span><span style="font-family:Calibri;">IIC</span><span style="font-family:'宋体';">通信,显示效果清晰。</span></strong></p>
<br><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;"><strong>5、软件部分</strong></h3>
<hr class="horizontal-splitline normal-bold-2"><h2><strong><span style="font-family:'宋体';">编译参数</span></strong></h2>
<p><strong>· <span style="font-family:'宋体';">编译器:</span>ARM Compiler version 5 (-O0)</strong></p>
<p><strong>· MDK<span style="font-family:'宋体';">版本:</span><span style="font-family:Calibri;">5.31</span></strong></p>
<p><strong>· <span style="font-family:'宋体';">调试器:</span>ST-Link V2 </strong></p>
<br><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;"><strong>6、BOM清单</strong></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;"><strong>工程内查看或者见下方表格。</strong></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、注意事项</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="font-size:18px;color:#e03e2d;">1.因为是其中一个USB口支持快充,所以,在使用USB1进行快充的时候,USB2不要接入其它设备,否则可能造成损坏。可以在USB1使用非快充设备时,两个USB输出口同时使用。</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:18px;color:#e03e2d;">2.晶振部分(X1,C12,C13),可以选择不装,空着。如果跟着装的话,需要更改程序的内容。</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:18px;color:#e03e2d;">3.目前没有为这个硬件设计外壳,有需要可自行设计。</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;">8、图片欣赏</h3>
<p><img src="//image.lceda.cn/pullimage/yUXtPvQN81NyICGoJz0bUhT65G2SEKTmmrmIDUZw.png" alt="" width="706" height="497"></p>
<p> </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/q5tx9shPY7qUPsFwUAc5ffz70iyEAzvJArY49wpa.png" alt="" width="707" height="505"></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/WBumsCmoDvzDA5ldKzXr2myHbC0nZ1dHOw1sboWZ.png" alt="" width="703" height="455"></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/tLzwWhtHEiJepEpZ44TsOC8yEfvjpm2V59TkPlDk.png" alt="" width="702" height="422"></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/aQa0RoQZVlcUvv98KSomVKUrOmmZoZ73SmMmQfra.png" alt="" width="703" height="493"></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/mhDhtqJ58dChGem0qHtI7q0fXP99STTi7unjmPzt.png" alt="" width="702" height="455"></p>
</div>
评论(0)