描述
<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:12pt;">* 1、项目功能介绍</span></h3>
<hr class="horizontal-splitline normal-bold-2">
<div>
<div class="ace-line old-record-id-OnucdVCVQowxQ7xqRwvcKNKfnPe"><span style="color:rgba(0,0,0,.85);font-family:Inter, '-apple-system', BlinkMacSystemFont, 'Segoe UI', 'SF Pro SC', 'SF Pro Display', 'SF Pro Icons', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12pt;background-color:#ffffff;">插件版小智 AI 对话机器人是一款基于 SF32LB52 芯片与立创开源蓝牙模组开发的便携式智能设备,主打 AI 实时语音交互功能。项目秉持 “全开源、易上手” 理念,硬件除主控外均采用插件元器件,降低焊接门槛,软件源码完全公开,支持用户快速搭建并体验 AI 对话能力,可连接互联网获取海量知识,满足日常信息查询、情绪互动等需求,适用于电子爱好者入门练习与智能设备 DIY 实践。</span></div>
</div>
<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:12pt;">*2、项目属性</span></h3>
<hr class="horizontal-splitline normal-bold-2">
<ol class="auto-hide-last-sibling-br" style="font-size:16px;background-color:#ffffff;margin:8px 0px 8px 0px;">
<li style="color:rgba(0,0,0,.85);"><span style="font-size:12pt;"><span style="border:0px solid;margin:0px;padding:0px;line-height:28px;color:#000000;">核心交互功能</span>:支持 AI 实时语音对话,借助立创开源蓝牙模组实现稳定的语音传输与识别,可精准响应用户指令,如查询天气(例:“小智,今天北京天气怎么样”)、播报时间(例:“小智,现在几点了”)、解答基础病情疑问(例:“小智,感冒了应该注意什么”),同时能结合互联网知识库解答各类生活、学习类疑难问题。</span></li>
<li style="color:rgba(0,0,0,.85);"><span style="font-size:12pt;"><span style="border:0px solid;margin:0px;padding:0px;line-height:28px;color:#000000;">情绪感知功能</span>:通过语音语义分析技术识别用户情绪,当检测到用户情绪低落时,可主动输出安慰语句;用户分享喜悦时,能给予积极回应,实现更具温度的人机交互。</span></li>
<li style="color:rgba(0,0,0,.85);"><span style="font-size:12pt;"><span style="border:0px solid;margin:0px;padding:0px;line-height:28px;color:#000000;">便携使用特性</span>:整体尺寸小巧(带外壳长 68.mm× 宽 48mm× 厚 35mm),重量轻,便于随身携带,可在家庭、办公、户外等多种场景下使用,无需复杂安装,开机即可启动语音交互。</span></li>
</ol>
<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:12pt;">* 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;"><span style="font-size:12pt;">本项目硬件设计参考自:<a href="https://lceda002.feishu.cn/wiki/B2LLwyC7binHuJkkHGMce03wnWf?fromScene=spaceOverview" target="_blank">插件版小智AI设计教程 - 飞书云文档</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;"><span style="font-size:12pt;">本项目软件烧录教程:<a href="https://oshwhub.com/article/the-10th-lichuang-electric-contest-xiao-zhi-ai-assistant-burning-tutorial" target="_blank">#第十届立创电赛#小智AI助手烧录教程 - 嘉立创EDA开源硬件平台 </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;"><span style="font-size:12pt;"><a href="https://wiki.lckfb.com/zh-hans/hspi-sf32lb52/lckfb-open-sf32lb52-mod/" target="_blank">立创·开源SF32LB52模组 | 立创开发板技术文档中心</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;"><span style="font-size:12pt;">硬件设计PCB教程:https://www.bilibili.com/video/BV1tzbJzbEt5</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;">思澈科技的SiFli-SDK:<a href="https://docs.sifli.com/projects/sdk/latest/sf32lb52x/quickstart/install/script/windows.html" target="_blank">Windows 安装流程 - SiFli SDK编程指南 文档</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;"><span style="font-size:12pt;">软件码源:<a href="https://docs.sifli.com/projects/xiaozhi/source-build/" target="_blank">源码构建 | 小智百科全书</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;"><span style="font-size:12pt;"><a href="https://github.com/78/xiaozhi-sf32" target="_blank">78/xiaozhi-sf32: Build your own AI friend via Bluetooth by SF32</a></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="font-size:12pt;">*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="font-size:12pt;">完整原理图:<img src="//image.lceda.cn/pullimage/jUeDPk5f3KxA7GRqYzMCPljPvTKfYjwVurYIsXnX.png" alt=""></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;"><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 pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/EByulXm5hAidfag1D8isRzl7KpyNJcx26D5ThSOn.png" alt="" width="493" height="369"></span><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/PIOweShr5HZCqynGGZvExp9GVgJO5GQtWc6vAaQb.png" alt="" width="499" height="583"></span></p>
<p><span style="font-size:12pt;">1.电源部分:</span></p>
<p><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/ILMsPAdQ7jYZECWqlT0u3kALQmtYGus174a9Q0ZV.png" alt="" width="419" height="293"></span></p>
<p><span style="font-size:12pt;">BAT1 是一个<a href="https://item.szlcsc.com/6030883.html" target="_blank">电池盒</a>,可以容纳一节 CR123A 电池。供电使用 CR123A 型柱形电池进行供电。或者可以使用3.7v锂电池进行供电。</span></p>
<p><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/8MbVuop0xR6vw3tR6MpDta1NM9OtRJ1XSAqwpBiV.png" alt="" width="412" height="427"></span></p>
<p><span style="font-size:12pt;">CR123A 型柱形电池链接:<a href="https://item.taobao.com/item.htm?id=607837531897&pisk=g4qaGMs7jGIahqACfWn2LZ8tNcntAm55ioGjn-2mCfcGkAsD0-yohOCAByk0GWBABcwmgSPI9nMfWsK4T5wu5VNb5jDmtW26fjstuSy7wStfXPMD0WwxoSZ4Hnk0nSBtGOQQBRnxm_1S0gwTBtagGmEZsJv3pxdMswgM7My1d_15Vi7MKm5NNSOHFIVnUYmmIqYiK9kjQhD0iq2HtXHxnCDDj9yn9XxMjq0MtJDonAAgix2HtAHvsFciSpjnEXcmmmV0K9kjtjmmmS2nCRaYrZkxS9P7EYDPsjgZZRce4JEEIMGP2XxD3kDaLb2Gknx0YAuaxnLvLd0_o838f-s2vcwz-DD4DTYqg4z0fDqGtg0Kor4SuyOGC7V4KSn_xtYiZPNsxl4ynn2EbP0xQ2RNTbqTKunnRgXzKkF_BkyXniDQNX2TjmSlecoisDkLc6Kigy40fVnvsslYYJqgugz6MvxGDoUwiEuipvl5L98CNUaFXUlpDELxW6DENOAkkE3ipvl5L98vkVUsLb6MZ&spm=tbpc.boughtlist.suborder_itempic.d607837531897.df322e8dmMAKp5" target="_blank">德力普cr2锂电池16340拍立得3V碟刹锁mini25相机3.7v充电器cr123a-淘宝网</a></span></p>
<p><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/utKxgQ8MPGNtNMTogE9pLbYvIWfkcoym4YQx4TIn.png" alt="" width="332" height="474"></span></p>
<p><span style="font-size:12pt;"><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">SW1 是拨动的电源开关,通过拨动 SW1 开关,进行断电和通电。</span></span></p>
<p> </p>
<p><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';font-size:12pt;background-color:#ffffff;">2.主控芯片:</span></p>
<p><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';font-size:12pt;background-color:#ffffff;"><img src="//image.lceda.cn/pullimage/p0GWnW0CkIfNfKKKpuSVWr2j6ppmAAcLFXkhWiLJ.png" alt=""></span></p>
<p><span style="font-size:12pt;"><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">芯片购买链接:</span><a href="https://item.szlcsc.com/45024582.html?lcsc_vid=E1JXAgEEQVIMAlJUFVdeUwVSQAQLAVxfFgJZUldTQFExVlNTQFBbVl1RQ1RaVzsOAxUeFF5JWA0NAgAHR1FcSQIDHhIGEkoFGU4%3D" target="_blank">LC-OPEN-SF32LB52-MOD-N16R8中文资料_最新报价_数据手册下载_立创开发板-蓝牙模块-立创商城</a></span></p>
<p><span style="font-size:12pt;"><span style="color:rgba(0,0,0,.85);font-family:Inter, '-apple-system', BlinkMacSystemFont, 'Segoe UI', 'SF Pro SC', 'SF Pro Display', 'SF Pro Icons', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:#ffffff;">该模组主控采大小核架构,大核强算力、小核低功耗,图形处理与双模蓝牙 5.3 表现优,存储足、接口全,适配 AI 交互、智能穿戴等场景,平衡性能与续航。</span><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">模组支持锂离子电池供电,电池 VBAT+ 直接连模组 VSYS 管脚。也支持用 DCDC 或 LDO 等电源芯片输出 给 VSYS 供电,电压范围要求 3.7V~4.7V。 </span><code>SF32LB52-MOD-1</code><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;"> 支持PCB板载天线,另有型号支持通过 IPEX 连接器连接外部天线,工作温度 </span><code>-40</code><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;"> 到 </span><code>85°C</code><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">。</span>其中管角VDD33_VOUT2 是软件控制的,在芯片正常启动后才有输出3V3。</span></p>
<p><span style="font-size:12pt;">引脚复用表:</span></p>
<p><span style="font-size:12pt;"><img style="font-size:14px;" src="//image.lceda.cn/pullimage/6PcogBRsN6xfVlZv6XAcbaJlk3pQu9t7JuEm9Ast.png" alt=""></span></p>
<p><span style="font-size:12pt;">主控芯片管脚连接情况:</span></p>
<p> </p>
<div>
<div class="old-record-id-E7RCdq1Cjozym0xVrKjcPNiynUc"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/oCkXIuxb56QtZEJwLeuFjidNpf5kON4pVUVDYuK6.png" alt="" width="809" height="483"></span></div>
<div class="old-record-id-E7RCdq1Cjozym0xVrKjcPNiynUc"> </div>
<div class="old-record-id-E7RCdq1Cjozym0xVrKjcPNiynUc"><span style="font-size:12pt;">3.串口下载</span></div>
<div class="old-record-id-E7RCdq1Cjozym0xVrKjcPNiynUc"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/XOaWQvVfU3f77ZOmDWB5iznCbFdScN2SfaYmRzwu.png" alt="" width="641" height="258"></span></div>
</div>
<p><span style="font-size:12pt;"><span style="color:rgba(0,0,0,.85);font-family:Inter, '-apple-system', BlinkMacSystemFont, 'Segoe UI', 'SF Pro SC', 'SF Pro Display', 'SF Pro Icons', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:#ffffff;">串口采用ch340型号下载器,通过</span>PA18 和 PA19 引脚进行收发,同时接地,<span style="color:rgba(0,0,0,.85);font-family:Inter, '-apple-system', BlinkMacSystemFont, 'Segoe UI', 'SF Pro SC', 'SF Pro Display', 'SF Pro Icons', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:#ffffff;">只需要连接三根线就可以完成烧录。</span></span></p>
<p> </p>
<p><span style="font-size:12pt;">4.LED指示灯</span></p>
<p><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/KbhLjKMo4wOO7T3skrWOmRXBC2TQ7QcYlctsE2JU.png" alt="" width="546" height="104"></span></p>
<div>
<div class="ace-line old-record-id-SfBddWO3yoozmYxOHc5cOWqun7W"><span style="font-size:12pt;">用来指示焊接烧录状态。焊接完毕无误进行烧录前上电,LED灯亮起,烧录后,LED灯灭。通过软件控制IO口。IO口输出低电平LED灯亮,IO口输出高电平LED灯灭。</span></div>
<div class="ace-line old-record-id-SfBddWO3yoozmYxOHc5cOWqun7W"> </div>
<div class="ace-line old-record-id-SfBddWO3yoozmYxOHc5cOWqun7W"><span style="font-size:12pt;">5.按键唤醒模块</span></div>
<div class="ace-line old-record-id-SfBddWO3yoozmYxOHc5cOWqun7W"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/1ot1FbUu8a6faXqL6jgJGqSRlAY8RFyE9RSxKuJB.png" alt="" width="640" height="234"></span></div>
<div class="ace-line old-record-id-SfBddWO3yoozmYxOHc5cOWqun7W">
<div class="ace-line old-record-id-JRR0duiYZo3tGVxOFVZc7V6xnig" style="font-size:12pt;">AI小智可以通过按键唤醒,通过按键进行控制,按下 U2 按键可以让主控从低功耗睡眠状态唤醒,当主控正在工作时,按下按键进行语音输入。</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">U1按键用途待定,可通过软件设计该按键用途。</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"> </div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">6.1.69寸彩色屏幕:</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/K1YevzmF24dwAyrm09aI17RqTTr2JxGVBQ7BeHLf.png" alt="" width="630" height="282"></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">
<div class="ace-line old-record-id-BxRmdTHk6opH1tx8XWccxVCXnhe">屏幕显示使用的是 1.69寸TFT彩屏幕,1.69寸彩色屏幕链接:<a href="https://item.taobao.com/item.htm?id=890566679777&pisk=gneTGbjg3wbM3KYwXrfhn5VMVMjnB6qaYPrWnq0MGyULkuKgsj0mGxUzyj9c_AcxHyg3IVqiCmGbozNi550DH-UUWdvmCrXxluPF0VmgInnbOPp0sl0g9nHaK5vmSNkYczDAraXlElrZgx_lrX92DMkS0cO6oVtIRxmYtlOMVlrZ3qtHl_VQbnI6xNbscqsKdmn9hxG612GI8mv6GrgsOei-4xgblrgIRmnv5q9shvTI8ctslciXOBiSXFT6CrZCvm3IlxG_lksK02gjBAWiuagyH5N4le3R7uvXhJntO6qsRurRmclOFl3BhawEXUu7f2pXh4BDzfELjNpzxAyuy04GddU8cuPj9-LCyqyLARNbYFQjYSaidVD51HHgQlNSG8_2GzHTkbws9nsYjlgtpDw5mQu3pV4bBXskejDQEbM_t67iiAn8lRz9DKa7xu2ZT-QJRqPi4viY3gOxkjsyO82JEuYoymA1vMd2gfiehorqMfp5IIoKrM0pgIlLuD3lvMd2gfiEv4jH_IRq9r5..&spm=tbpc.boughtlist.suborder_itempic.d890566679777.df322e8dmMAKp5" target="_blank">1.69寸彩色TFT显示屏高清IPS LCD液晶屏模块240*280 SPI接口-淘宝网</a></div>
<div class="ace-line old-record-id-D3bCdR0Rpoa1VtxvC5Ccgv0JnBe">本屏幕通过SPI协议控制,供电 3.3V。SPI的通信引脚,可使用主控的硬件SPI外设。但使用主控的硬件SPI外设,则需要选择特定的引脚,进行引脚复用。</div>
<div class="ace-line old-record-id-D3bCdR0Rpoa1VtxvC5Ccgv0JnBe">本主控芯片的管教复用表如下:</div>
<div class="ace-line old-record-id-D3bCdR0Rpoa1VtxvC5Ccgv0JnBe"> </div>
<div class="ace-line old-record-id-D3bCdR0Rpoa1VtxvC5Ccgv0JnBe">屏幕引脚与芯片管脚网络标签及连接说明:</div>
<div>
<table class="ace-table" style="border:none;table-layout:fixed;width:500px;height:216.289px;">
<tr style="height:22.371px;">
<th style="border-color:#dee0e3;padding:8px;vertical-align:top;font-weight:500;background-color:#f2f3f5;text-align:left;height:22.371px;" colspan="1" rowspan="1">主控管脚</th>
<th style="border-color:#dee0e3;padding:8px;vertical-align:top;font-weight:500;background-color:#f2f3f5;text-align:left;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-B3badvxOIozsZoxRpVKcsoIlnVe">屏幕引脚</div>
</th>
<th style="border-color:#dee0e3;padding:8px;vertical-align:top;font-weight:500;background-color:#f2f3f5;text-align:left;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-O6IXdLLy1owXpmxbHx1ccLvlnUb">功能说明</div>
</th>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-HQnodEsCSoswWsxjOtjco9wInqe" style="text-align:center;">GND</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-OdQsdzFlioyRXQxFsQTcxn2GnQc" style="text-align:center;">GND</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-OMood2AjEobGHQxUR7NcsYVGn1e">电源地</div>
</td>
</tr>
<tr style="height:37.3214px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:37.3214px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-MlJKdsOTRoGjlqx9vEvcPvMNnQe" style="text-align:center;">VDD33_VOUT2/3.3V</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:37.3214px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-Sax3dSarFoTL3LxJfYCcITRFnEc" style="text-align:center;">VCC</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:37.3214px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-K64IdBllQokzMsxw6lYchc6snub">电源输入</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-T4K8dDkczoFzhvxhbszc3AdQnpb" style="text-align:center;">PA04_SPI_CLK</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-Ftdtd8xYxoSqlZxVt1lcmVvCnxc" style="text-align:center;">DO(SCL)</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-HuxrdJl2so6ucXxrghjcolHinbh">通信时钟引脚</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-GehQdsePhoenhoxfQ6sctavrnUb" style="text-align:center;">PA05_SPI_MOSI</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-SNybdXOQBontUnxnARGcIY1snBb" style="text-align:center;">DA(SDA)</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-DCPkdbq7soZTQYxnYmpcngp2nOd">通信数据引脚</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-XOP4dVYG9oLchMxfU0TcH6Aknxd" style="text-align:center;">PA00_SPI_RESET</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-QGLtdaDgUoMoA6x4eodcEljJngg" style="text-align:center;">RES</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-G9KcdyFhdogSn5xXRBjcGXz5nHg">复位引脚</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-OkOddefOxojwDCxEPsQc6ldMnrd" style="text-align:center;">PA06_SPI_D/C</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-JSGOdYqRLoDf4txVgh0cLFo6nt6" style="text-align:center;">D/C</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-MhMYdHLodo1yQVxFqbDcUS4Lnhc">读写功能引脚</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-JTDXdN8HhobyZkxQhbucTiN0nlB" style="text-align:center;">PA03_SPI _CS</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-KwU5duj76oCgcSxdwwzcznaYnle" style="text-align:center;">CS</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-H7JTd2fLloDtF7x7HBdcZwfqnd0">片选引脚</div>
</td>
</tr>
<tr style="height:22.371px;">
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-VOEvdI2OLo3o6xxEdZPcUQzlnHd" style="text-align:center;">PA42_LED_BL</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-H3dEd0PAWoomPyxg6pfcYrkFnFc" style="text-align:center;">BLK</div>
</td>
<td style="border-color:#dee0e3;padding:8px;vertical-align:top;height:22.371px;" colspan="1" rowspan="1">
<div class="ace-line old-record-id-XMpJdub0SohDsqxKjozczg0RnKb">背光控制引脚,高电平屏幕背光亮</div>
</td>
</tr>
</table>
<p> </p>
<p><span style="font-size:12pt;">7.音频功放与喇叭:</span></p>
<p><span style="font-size:12pt;"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/0BP1xRe0rXAK64d4guvCKmwAQc6mduFGP84VPVl9.png" alt="" width="693" height="260"></span></span></p>
<div>
<div class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;">音频功放型号是 LM4871,LM4871是一款3W、单声道AB类音频功率放大器。工作电压 1.9-5.5V,以BTL桥接方式,在5V电源供电情况下,可以给4Ω负载 提供THD小于10%、平均3.0W的输出功率。在关断模式下,电流典 型值小于0.5μA。</span></div>
<ul>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;">工作电压:1.9-5.5V 创新的“开关/切换噪声”抑制技术,杜绝了上电、掉电出现的噪声 </span></li>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;"> 10%THD+N,VDD=5V,4Ω负载下,提供高达2.9W的输出功率 </span></li>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;"> 10%THD+N,VDD=5V,8Ω负载下,提供高达1.8W的输出功率 </span></li>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;">关断电流<0.5μA </span></li>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;">过温保护 </span></li>
<li class="ace-line old-record-id-VThjdrlxhoetkfxINm9ciXDHnxe"><span style="font-size:12pt;">提供SOP-8、ESOP-8、DIP-8、MSOP-8、EMSOP-8和DFN-8封装</span></li>
</ul>
</div>
</div>
</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/UYqRMSaCqQN96ybODQR5Kqfu52YDsYKAq205y2Ar.png" alt="" width="718" height="528"></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl"><span style="font-size:12pt;"><span style="font-size:12pt;">Shutdown 脚工作模式选择 为了省电,在不使用放大器时,可以关闭放大器,LM4871 有掉电控制管脚 Shutdown, 可以控制放大器是否工作。该控制管脚的电平必须要接满足接口要求的控制信号,否则芯片可 能进入不定状态。 暨Shutdown 脚通过施加以下三种不同电平状态,芯片则分别进入三种不 同工作模式: 低电平:芯片处于正常工作模式。因此,在使用过程中,务必让此引脚保持低电平。 高电平:芯片进入掉电工作模式,关闭放大器,无输出信号,通过选择进入此状态,能有 效减少能耗,达到省电目的。 空 置:芯片处于不定状态,不仅不能够进入掉电模式,其自功耗没有降低,达不到节电 目的;而且易对芯片造成不良影响,因此在芯片长期工作时,切忌勿让其处于悬空状态。</span></span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl"> </div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl"><span style="font-size:12pt;">1管脚 Shutdown 是芯片掉电控制引脚,默认接高电平时</span><span style="font-size:16px;">停止</span><span style="font-size:12pt;">工作可以实现低功耗;</span><span style="font-size:16px;">软件控制输出</span><span style="font-size:12pt;">低电平时功放正常工作。功放电路利用</span><span style="font-size:16px;">电阻</span><span style="font-size:12pt;">R5使该引脚接高电平即芯片默认停止工作,当需要功放工作时,需要主控的 PA26 引脚输出低电平才能工作,这样只有需要用的时候才开,不用的时候默认关闭,可以实现低功耗。</span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><span style="font-size:12pt;">根据芯片数据手册的典型应用电路和项目的实际情况,采用差分输入模式电路。实际电容电阻阻值有改变0.39uf和0.1uf更改为100nf,20k电阻更改为10k。</span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/IEFUm55lw69U7NCus2EPxiVVFGMTBQof2VQgVLeA.png" alt="" width="704" height="446"></span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"> </div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><span style="font-size:12pt;">8.麦克风咪头</span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/lbsh9EAWoROX91LdbAy6ZL6RdhahtPRCyrPX6n9H.png" alt="" width="688" height="416"></span></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">
<p class="ds-markdown-paragraph" style="margin:16px 0px;color:#0f1115;font-family:'quote-cjk-patch', Inter, 'system-ui', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;background-color:#ffffff;"><span style="font-size:12pt;">“咪头”是行业和爱好者对麦克风电容音头的俗称,更专业的叫法是换能器。它是麦克风中最关键、最核心的部件,直接负责将声音信号(声波)转换成电信号。可以说,麦克风音质的基础和上限在很大程度上由咪头决定。</span></p>
<p class="ds-markdown-paragraph" style="margin:16px 0px;color:#0f1115;font-family:'quote-cjk-patch', Inter, 'system-ui', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;background-color:#ffffff;"><span style="font-size:12pt;">咪头的工作原理(以最常见的电容式咪头为例)</span></p>
<p class="ds-markdown-paragraph" style="margin:16px 0px;color:#0f1115;font-family:'quote-cjk-patch', Inter, 'system-ui', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;background-color:#ffffff;"><span style="font-size:12pt;">电容式咪头的工作原理可以理解为一个可变的电容器。</span></p>
<ol style="margin:16px 0px;background-color:#ffffff;">
<li>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">结构:它主要由两片极薄的金属振膜组成,一片是固定的(称为背极),另一片是极薄、可以振动的(称为振膜)。两者之间的距离非常近,但并不接触,形成一个电容器。</span></p>
</li>
<li style="margin-top:6px;">
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">极化:在工作时,需要给这个电容器两端施加一个恒定的电压(称为极化电压),使其储存电荷。</span></p>
</li>
<li style="margin-top:6px;">
<p class="ds-markdown-paragraph" style="margin:0px 0px 8px;"><span style="font-size:12pt;">声波转换:当声音传来时,声波的压力会使振膜发生振动,从而改变振膜与背极之间的距离。</span></p>
<ul style="margin:4px 0px 0px;padding-left:18px;">
<li>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">距离变近 -> 电容容量增大</span></p>
</li>
<li style="margin-top:6px;">
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">距离变远 -> 电容容量减小</span></p>
</li>
</ul>
</li>
<li style="margin-top:6px;">
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">信号生成:电容量的变化会导致电容器两端电压的相应变化。这个随时间变化的微小电压,就是对我们声音最原始的“电学复制品”,也就是最初的音频电信号。</span></p>
</li>
<li style="margin-top:6px;">
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">放大:这个原始电信号非常微弱(毫伏级),无法直接使用。因此,咪头内部或外部紧接着一个预放大器,将其放大到可用的电平(线路电平)。</span></p>
</li>
</ol>
<p class="ds-markdown-paragraph" style="margin:16px 0px;color:#0f1115;font-family:'quote-cjk-patch', Inter, 'system-ui', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;background-color:#ffffff;"><span style="font-size:12pt;">小结:声波 -> 振膜振动 -> 电容量变化 -> 电压变化 -> 生成微弱的音频信号 -> 预放大。</span></p>
<p class="ds-markdown-paragraph" style="margin:16px 0px;color:#0f1115;font-family:'quote-cjk-patch', Inter, 'system-ui', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;background-color:#ffffff;"><span style="font-size:12pt;">驻极体咪头</span></p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">本质:它也属于电容式咪头的一种。特殊之处在于,它的振膜材料是经过特殊处理的驻极体,自身带有永久电荷,因此不需要外部提供极化电压,但仍需要供电给内置的放大器电路。</span></p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">优点:体积可以做得非常小、成本低、功耗低。</span></p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">缺点:性能和寿命通常不如需要外部极化电压的专业电容咪头。</span></p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">应用:手机、蓝牙耳机、笔记本电脑、摄像头等消费电子产品中的内置麦克风。</span></p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;">驻极体</span>麦克风数据手册典型应用电路:</p>
<p class="ds-markdown-paragraph" style="margin:0px;"><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/WxY37pOFiJXXgxyVmgDy4HyXvm2oPDR6qze1UeEr.png" alt="" width="560" height="269"></span></p>
</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">
<div>
<div class="ace-line old-record-id-RdtOdUlpxoMM4dxR5NTcc9kynNd">在本项目实际麦克风电路中,R1电阻的作用就是给麦克风的正极输入一个基准电压MIC_BIAS,这个电压是由主控芯片控制输出的,由主控控制可以在需要时才输出,不用时关闭,实现低功耗。在参考电路中R1阻值为2.2K,在实际电路中,R1实际电阻值为 10K,测试效果能够接受,过低则采集的音频信号弱,过高则易引入噪声。</div>
<div class="ace-line old-record-id-KnoNdHRuNongD8xj85rcdlSanvd"><span style="font-size:12pt;">在本项目实际麦克风电路中</span>,U2电容的作用就是对采集的信号进行滤波,滤除高频噪声,大多是滤除滋滋滋的声音或者声音沙哑问题。</div>
</div>
</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"> </div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">9.焊接注意事项</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">可以采用电烙铁进行焊接,焊接主控芯片时可以使用焊枪或者焊台,若没有则可以使用刀头电烙铁进行拖焊。主控芯片内有片焊盘,可以自行选择是否焊接,焊接焊盘可以帮助散热和使用Flash空间。</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">焊接顺序按照先小后大,先顶层后底层原则。焊接电池盒要注意器件,可能焊接空间过于狭小。</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">焊接实物图:</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/5U45FT8DKVRnWeQFxnn5aSLX6gOv4Uh6ufawraR6.png" alt="" width="307" height="409"><img style="font-size:14px;" src="//image.lceda.cn/pullimage/eLd86o8yyAjDCLws5jIKixcI4YLxhsEfm1ZGPdAI.png" alt="" width="362" height="483"></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">焊接完成上电测试:</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/8qpZGFc3ujCuXYW6uzTuS9Xs3JTmoQIzTgiKEstn.png" alt="" width="637" height="392"></div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;"> </div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">10.情况说明</div>
<div class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">3D打印模型暂时有问题,无法完整放进模型。有两个问题:</div>
<ol>
<li class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">拨动开关位置不对,焊接在底层,但是实际高度在顶层。</li>
<li class="ace-line old-record-id-SyaJdTFCxomdEAxZL3GchHnpnBl" style="font-size:12pt;">麦克风位置偏左边缺失一块,暂时没有找到问题。</li>
</ol>
</div>
</div>
<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:12pt;">*5、软件部分</span></h3>
<hr class="horizontal-splitline normal-bold-2">
<p><span style="font-size:16px;">软件烧录教程参考</span><a style="font-size:12pt;" href="https://oshwhub.com/article/the-10th-lichuang-electric-contest-xiao-zhi-ai-assistant-burning-tutorial" target="_blank">#第十届立创电赛#小智AI助手烧录教程 - 嘉立创EDA开源硬件平台</a></p>
<p><span style="font-size:12pt;">问题参考黄山派</span><a href="https://wiki.lckfb.com/zh-hans/hspi-sf32lb52/lckfb-hspi-sf32lb52/xiaozhi.html" target="_blank">小智烧录和使用 | 立创开发板技术文档中心</a></p>
<p><span style="font-size:12pt;">硬件准备:</span></p>
<ul>
<li><span style="font-size:12pt;">准备下载器和3根杜邦线(按照tx,rx,gnd分别对应2,4,6)。烧录时ch340rx/tx灯要亮起,若没有交换tx/rx连接线。</span><img src="https://image.lceda.cn/oshwhub/pullImage/af78cddc1b07470b81903d7a1c52e8ba.png" alt="image.png" width="448" height="185"></li>
<li><span style="font-size:12pt;">小智AI项目成品(装上电池,插上屏幕,安上喇叭)。</span></li>
</ul>
<p><span style="font-size:12pt;">软件准备:</span></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 pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:12pt;">下载sftool(用于SF32系列SoC芯片的烧录),</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 pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:12pt;">下载固件(开发板的固件链接<a style="white-space:pre;" href="https://github.com/78/xiaozhi-sf32/releases" target="_blank">https://github.com/78/xiaozhi-sf32/releases</a><span style="white-space:pre;">,我们下载最新release版本的压缩包。需要注意的是,我们一共需要</span><span style="white-space:pre;">五个固件。</span>)</span></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;">使用命令行进行烧录,烧录前要<span style="color:#252933;font-family:'Microsoft YaHei', '微软雅黑', '宋体', 'Arial Narrow', HELVETICA;background-color:#ffffff;">右键win图标,点击【设备管理器】,在设备管理器找到【端口】,记住CH340的COM口号,后续使用命令行时需要更改。</span></span></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;color:#000000;"><span style="font-family:'Microsoft YaHei', '微软雅黑', '宋体', 'Arial Narrow', HELVETICA;background-color:#ffffff;"><span style="font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';">在文件夹空白处,右键以终端打开,输入以下命令,替换串口设备端口号以及固件文件路径,其他选项参数使用默认即可,命令:.\sftool.exe -c SF32LB52 -p com端口号 write_flash bootloader.bin@0x12010000 main.bin@0x12020000 ftab.bin@0x12000000</span></span></span></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;color:#000000;"><span style="font-family:'Microsoft YaHei', '微软雅黑', '宋体', 'Arial Narrow', HELVETICA;background-color:#ffffff;"><span style="font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';"><span style="color:#252933;font-family:'Microsoft YaHei', '微软雅黑', '宋体', 'Arial Narrow', HELVETICA;">回车后,烧录程序就开始了。</span></span></span></span></li>
<li class="lark-record-clipboard"><img src="https://image.lceda.cn/oshwhub/pullImage/1420abf94dbb49708bc356b6600a3dfb.png" alt="image.png" width="695" height="208"></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;"><span style="color:#000000;">烧录完成要上电重新启动,同时</span><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">在连接板子设备之前,请打开手机的蓝牙网络共享功能,</span></span></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;"><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">烧录固件之后,确保蓝牙共享网络已打开,这时,手机就可以连接蓝牙 sifli-pan 设备了。</span></span></li>
<li class="lark-record-clipboard"><span style="font-size:12pt;"><span style="color:#3c3c43;font-family:'Punctuation SC', Inter, 'ui-sans-serif', 'system-ui', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';background-color:#ffffff;">连接上sifli-pan设备后,开发板会有连接画面提示,此时按下对话按键(KEY2),xiaozhi则会提示需要登录到控制面板,填设备码。 这个时候,打开浏览器,输入网址:xiaozhi.me 浏览器用手机或者电脑都可以。 进入小智 AI 的网页后,点击控制台,用手机号登录。</span></span></li>
</ul>
<p><span style="font-size:12pt;">主函数说明:这段 main.c代码是一个基于 RT-Thread 的嵌入式主程序,主要实现了蓝牙 PAN 连接管理、UI 线程、电池检测、脉冲编码器、睡眠定时器等功能。</span></p>
<p><span style="font-size:12pt;">main函数展示:</span></p>
<p><span style="font-size:12pt;"><img src="//image.lceda.cn/pullimage/viNcT7p5Nu9EBT0o0oaJItgzwW1BK6tbcEe0CK8v.png" alt=""></span></p>
<p><span style="font-size:12pt;color:#000000;">main函数的执行顺序如下:</span></p>
<p> </p>
<ol>
<li><span style="font-size:12pt;color:#000000;">调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">check_poweron_reason</a> 检查上电原因。</span></li>
<li><span style="font-size:12pt;color:#000000;">创建按钮事件邮箱 g_button_event_mb。</span></li>
<li><span style="font-size:12pt;color:#000000;">打印 "Xiaozhi start!!!"。</span></li>
<li><span style="font-size:12pt;color:#000000;">设置音量,调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">audio_server_set_private_volume</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">设置 LCD 亮度,调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">xz_set_lcd_brightness</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">初始化物联网模块,调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">iot_initialize</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">初始化时间和天气,调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">xiaozhi_time_weather_init</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">初始化音频,调用 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">xz_ws_audio_init</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">(部分板卡)设置硬件寄存器和传感器引脚。</span></li>
<li><span style="font-size:12pt;color:#000000;">创建 UI 线程,启动 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">xiaozhi_ui_task</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">创建蓝牙事件邮箱 g_bt_app_mb。</span></li>
<li><span style="font-size:12pt;color:#000000;">注册蓝牙事件回调 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">bt_app_interface_event_handle</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">使能 BLE。</span></li>
<li><span style="font-size:12pt;color:#000000;">创建并启动电池线程,执行 <a style="color:#000000;text-decoration:underline;" title="" target="_blank">battery_level_task</a>。</span></li>
<li><span style="font-size:12pt;color:#000000;">(部分板卡)初始化脉冲编码器,创建并启动定时器。</span></li>
<li><span style="font-size:12pt;color:#000000;">进入主循环,等待并处理蓝牙相关事件(如 PAN 连接、断开、重连等),并根据事件调用相关 UI 和功能接口。</span></li>
</ol>
<p><span style="font-size:12pt;">main函数主要功能:</span></p>
<p> </p>
<ol>
<li>
<p><span style="font-size:12pt;color:#000000;">硬件初始化与配置</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">HAL_MspInit():初始化板级 IO、定制引脚配置。</span></li>
<li><span style="font-size:12pt;color:#000000;">check_poweron_reason():判断上电原因(冷启动、RTC 唤醒、长按开机等),决定是否继续启动或关机。</span></li>
</ul>
</li>
<li>
<p><span style="font-size:12pt;color:#000000;">线程与定时器管理</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">UI 线程和电池线程分别负责界面刷新和电池电量检测。</span></li>
<li><span style="font-size:12pt;color:#000000;">pulse_encoder_init() 和 pulse_encoder_timeout_handle():初始化脉冲编码器设备,定时读取编码器计数并调整音量。</span></li>
<li><span style="font-size:12pt;color:#000000;">sleep_timer_timeout_handle() 和 start_sleep_timer():管理睡眠定时器,超时后设置进入睡眠标志。</span></li>
</ul>
</li>
<li>
<p><span style="font-size:12pt;color:#000000;">蓝牙连接管理</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">通过邮箱(rt_mailbox_t)和定时器实现蓝牙连接、断开、重连等事件的异步处理。</span></li>
<li><span style="font-size:12pt;color:#000000;">bt_app_interface_event_handle():处理蓝牙事件,包括连接、断开、加密、配对等。</span></li>
<li><span style="font-size:12pt;color:#000000;">pan_reconnect():首次 PAN 连接失败时,最多尝试三次重连。</span></li>
</ul>
</li>
<li>
<p><span style="font-size:12pt;color:#000000;">电池电量检测</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">battery_level_task():周期性读取 ADC 电池电压,计算百分比并发送到邮箱。</span></li>
</ul>
</li>
<li>
<p><span style="font-size:12pt;color:#000000;">主循环与事件分发</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">main():初始化各模块,进入主循环,根据邮箱事件处理蓝牙连接、UI 状态、睡眠等。</span></li>
</ul>
</li>
<li>
<p><span style="font-size:12pt;color:#000000;">命令行接口</span></p>
<ul>
<li><span style="font-size:12pt;color:#000000;">Write_MAC、pan_cmd:通过 MSH 命令行接口支持 MAC 地址写入和 PAN 连接管理。</span></li>
</ul>
</li>
</ol>
<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:12pt;">*6、BOM清单</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;">喇叭和电池还有屏幕及母座需要单独购买,剩下均可在立创商店购买。</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;">喇叭推荐8欧2瓦,2415型号,价格在3元。一般8欧2瓦就行本人采用3070型号。可通过唤醒小智达到增大音量。</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;">母座是8pin的。电池和屏幕链接在原理图部分给出。</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;">最后记得购买烧录器,带ch340型号芯片即可。</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;">除去50元器材卷,另外37花费购买屏幕,喇叭,电池,烧录器。</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="font-size:12pt;">*7、大赛LOGO验证</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;"><img src="//image.lceda.cn/pullimage/Ja9o44L8H0Ge9VPUp92PYhxf4NK5eIeFbVmgGYb2.png" alt=""></span></p>
<h3 id="h_14342398105051757154505401" 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;">* 8、演示您的项目并录制成视频上传</span></h3>
<hr class="horizontal-splitline normal-bold-2">
<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;"> </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;"><a href="/posts/42551e8f2f2548cabc1c36626a42da94" target="_blank">前往查看更多详情 ></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>
评论(1)