描述
<p><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;"><img src="//image.lceda.cn/oshwhub/d90416c1c3764486b7509b4dfa1b5c38.jpg" alt="" width="296" height="222" /></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="font-size: 18pt;"><em> 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="font-size: 12pt;">STM32G030K6T6作为主控</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: 12pt;">使用SN74HC595移位寄存器控制三位数码管(推荐使用灵星芯微,有16-15劵)</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: 12pt;">SHT40温湿度传感器检测到的数据通过三位数码管显示出来</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: 12pt;">2节五号电池供电</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: 12pt;">具有低功耗模式,使用时点击唤醒按键。</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>
<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="font-size: 18pt;"></em>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: #95a5a6; font-size: 12pt;">立创EDA训练营项目(第九届立创电赛)</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>
<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="font-size: 18pt;"><em> 3、开源协议</span></h3>
<hr class="horizontal-splitline normal-bold-2" />
<p><span style="font-size: 12pt;">Public Domain</span></p>
<p 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;"><strong><span style="color: #0093e6;">请在竞赛阶段填写 ↓</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;"><span style="font-size: 18pt;"></em>4、硬件部分</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: #95a5a6; font-size: 12pt;">1. 焊接MCU和移位寄存器经常出现短路和漏焊,从而造成数码管部分未点亮的现象。(例如:小数点没点亮、第一排数码管某一行没点亮)。</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: #95a5a6; font-size: 12pt;">通过原理图/PCB找到对应芯片的对应引脚重新加工。</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: #95a5a6; font-size: 12pt;">注意事项:</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: #95a5a6; font-size: 12pt;">焊接体积小、引脚多的芯片的时候,推荐使用助焊剂,用小刷子(油画笔)刷在芯片周围用平头烙铁焊接,多余的焊锡可以用烙铁一点点点掉或者使用吸锡带。 同时注意烙铁接触时间不能过长,否则容易烫坏芯片和电路板。</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: #95a5a6; font-size: 12pt;">SN74HC595芯片封装换成 SOP-16 ,芯片会大很多,引脚间距也大很多,同样占用空间也大(小白推荐)</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;"><span style="color: #95a5a6; font-size: 12pt;">2. 电阻/电容等常见元器件焊接:使用烙铁先在一侧点锡,放置器件,再添加另一侧的锡,注意摆放位置、个别区分正负极,最好做到摆放工整对其美观,焊锡点饱满。</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;"><span style="color: #95a5a6; font-size: 12pt;">3. 贴片LED,元器件的背面有和原理图相似的图形,正面带颜色的一侧为负,焊接时烙铁接触正极会发现LED点亮现象。</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;"><span style="color: #95a5a6; font-size: 12pt;">4. 因为设计的PCB板过小,且关键芯片SN74HC595距离数码管太近,空间狭小,后期如若出现数码管不能正常点亮的情况,难以使用电烙铁进行修复。</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: #95a5a6; font-size: 12pt;">在加上可能会出现数码管品质上的问题,不能正常工作。数码管引脚太多,取下来不太方便。</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: #95a5a6; font-size: 12pt;">因此推荐焊接排母,再将数码管插在排母上,同时也能随时更换共阴极数码管或共阳极数码管。</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: #95a5a6; font-size: 12pt;">排母选型:1<em>6P 2.54mm 和 1</em>5P 2.54mm</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: #95a5a6; font-size: 12pt;"><img src="//image.lceda.cn/oshwhub/d4faa1e79c3b4aa99dd51ec27257a0e9.jpg" width="306" height="276" /></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: #95a5a6; font-size: 12pt;">5. SHT40传感器没有直接焊接到板子上(贵),下方使用了1<em>4P 1.27mm的排母,将SHT40传感器插到排母上。注意正反,插反了可能会烧坏传感器。</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: #95a5a6; font-size: 12pt;">上电时触碰传感器,发烫立刻断电。</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: #95a5a6; font-size: 14px;"><img src="//image.lceda.cn/oshwhub/081e76e8e05e4ff5a832258a4b8a8e78.jpg" width="305" height="238" /></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: #95a5a6; font-size: 12pt;">6. 背面的电池座可以在下载完程序调试完成后再进行焊接,尤其是直接焊接数码管的时候,出问题维修难度急剧上升。</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: #95a5a6; font-size: 12pt;">注意:本次设计的PCB下方电池座负极区域,过孔和一根信号线过进,拆卸电池座损坏过孔会导致短路,烧坏MCU。(新工程已修改)</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;"><span style="color: #95a5a6; font-size: 14px;"> 注:请前往<span style="text-decoration: underline;"><a href="<a href="https://lceda.cn/editor" target="_blank">https://lceda.cn/editor</a>" target="_blank" rel="noreferrer noopener">嘉立创EDA</a> </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 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;"><span style="font-size: 18pt;"></em>5、软件部分</span></h3>
<hr class="horizontal-splitline normal-bold-2" />
<p><span style="font-size: 12pt;">1. LED</span></p>
<p><span style="font-size: 12pt;">两个LED均为低电平点亮</span></p>
<p><span style="font-size: 12pt;">GPIO输出高电平,两端没有电势差,LED不能点亮;</span></p>
<p><span style="font-size: 12pt;">GPIO输出低电平,两端存在电势差,LED点亮。</span></p>
<p> </p>
<p><span style="font-size: 12pt;">配置流程:</span></p>
<p><span style="font-size: 12pt;">开时钟</span></p>
<p><span style="font-size: 12pt;">GPIO配置:推挽输出、浮空输入、引脚、高速模式</span></p>
<p><span style="font-size: 12pt;">GPIO初始化</span></p>
<p><span style="font-size: 12pt;">配置空闲时刻LED状态(默认开/默认关)</span></p>
<p> </p>
<p><span style="font-size: 12pt;">2. 按键</span></p>
<p><span style="font-size: 12pt;">按键需要配置为输入模式,上拉(默认高电平)</span></p>
<p> </p>
<p><span style="font-size: 12pt;">配置流程:</span></p>
<p><span style="font-size: 12pt;">开时钟</span></p>
<p><span style="font-size: 12pt;">GPIO配置:上拉输入、引脚</span></p>
<p><span style="font-size: 12pt;">GPIO初始化</span></p>
<p> </p>
<p><span style="font-size: 12pt;">机械按键通常会有抖动,使用if语句嵌套进行消抖处理</span></p>
<p> </p>
<p><span style="font-size: 12pt;">3. 数码管</span></p>
<p><span style="font-size: 12pt;">使用SN74HC595移位寄存器,而没有选择直接用MCU控制数码管,大大节省了端口资源。</span></p>
<p><span style="font-size: 12pt;">SN74HC595引脚配置</span></p>
<p><span style="font-size: 12pt;">使能时钟</span></p>
<p><span style="font-size: 12pt;">配置为输出模式:推挽输出、高速</span></p>
<p><span style="font-size: 12pt;">初始化</span></p>
<p><span style="font-size: 12pt;">引脚初始化完成后,编写驱动函数与显示函数</span></p>
<p> </p>
<p><span style="font-size: 12pt;">驱动时序:</span></p>
<p><span style="font-size: 12pt;">输出高电平/低电平到SER引脚中,随后产生一个SCLK的上升沿,将数据发送出去。因为是8位移位寄存器,所以循环8次,最后一个发送完成后,RCLK的上升沿触发,将数据锁存,保持不变,直到下一次发送。</span></p>
<p> </p>
<p><span style="font-size: 12pt;">显示数据:</span></p>
<p><span style="font-size: 12pt;">两个数码管的阴极总共是6个阴极,全部连接在其中一个SN74HC595上,通过这一个595芯片,可以指定某一个位导通,同时,两个数码管的阳极,又分别连接在另外两个595芯片上,通过这两个芯片配合,就可以实现单个位显示数据。</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;"><span style="color: #95a5a6; 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 pap-left-indent-1.6em" 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;"><span style="font-size: 14px;"><a href="/posts/de460543d4cf4dacb5f0326612455578" target="_blank" rel="noreferrer noopener">前往查看更多详情 ></a></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>
</div></p>
评论(0)