70 lines
3.0 KiB
Markdown
70 lines
3.0 KiB
Markdown
# Bluetooth
|
||
|
||
## 模块介绍
|
||
|
||
|
||
### HC-08蓝牙模块
|
||
<div style="display: flex;justify-content: center;align-items: center;">
|
||
<img src = "./imagesrc/hc08.png" alt="hc08" width =50% max-width= 50% >
|
||
</br>
|
||
</div>
|
||
|
||
HC-08 蓝牙串口通信模块是新一代的基于Bluetooth Specification V4.0 BLE 蓝牙协议的数传模块。无线工作频段为2.4 GHz ISM,调制方式是GFSK。模块最大发射功率为4dBm,接受灵敏度-93dBm,空旷环境下和手机可以实现80米超远距离通信。</br></br>
|
||
|
||
模块大小 26.9mm×13mm×2.2mm,集成了邮票封装孔和排针焊接孔,既可以贴片封装,也又可以焊接排针,很方便嵌入应用系统之内。自带 LED 状态指示灯,可直观判断蓝牙的连接状态。</br></br>
|
||
|
||
模块采用 TI 的 CC2540F256 芯片,配置 256K 字节空间,支持 AT 指令,用户可根据需要更改角色(主、从模式)以及串口波特率、设备名称等参数,使用灵活。</br></br>
|
||
|
||
<div style="display: flex;justify-content: center;align-items: center;">
|
||
<img src = "./imagesrc/hc08_pin.png" alt="hc08_pin" width =50% max-width= 50% >
|
||
</br>
|
||
</div>
|
||
HC-08 蓝牙模块第27/28/29/30引脚含义:
|
||
<div>
|
||
<table style="margin-left: auto; margin-right: auto; table-layout: fixed;" width = 600>
|
||
<tr>
|
||
<td width = 100>序号</td>
|
||
<td width = 250>HC-08模块</td>
|
||
<td width = 250>备注</td>
|
||
</tr>
|
||
<tr>
|
||
<td>1</td>
|
||
<td>VCC(第27引脚)</td>
|
||
<td>模块3.3V 供电正</td>
|
||
</tr>
|
||
<tr>
|
||
<td>2</td>
|
||
<td>GND(第28引脚)</td>
|
||
<td>模块公共地</td>
|
||
</tr>
|
||
<tr>
|
||
<td>3</td>
|
||
<td>RXD(第29引脚)</td>
|
||
<td>UART输入口,3.3V TTL电平</td>
|
||
</tr>
|
||
<tr>
|
||
<td>4</td>
|
||
<td>TXD(第30引脚)</td>
|
||
<td>UART输出口,3.3V TTL电平</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
|
||
## 模块配置和代码树
|
||
|
||
对于Bluetooth 模块,默认配置就可以测试,可能需要修改的是UART设备的名字:</br>
|
||
|
||
[\*] Enable Bluetooth ---></br>
|
||
    --- Enable Bluetooth</br>
|
||
    [\*] Quectel HC08---></br>
|
||
        [ ] Enable initialize by thread</br>
|
||
        [\*] Enable sample ---> (是否编译测试例程)</br>
|
||
        (-1) Power pin ---> (电源引脚配置,与电路板相关,模块测试无需修改)</br>
|
||
        (-1) Power status pin ---> (电源状态引脚配置,与电路板相关,模块测试无需修改)</br>
|
||
        (uart3) AT client device name ---> (模块连接的UART名字,取决于模块和主板的连接方式)</br>
|
||
        (1024) The maximum length of receive line buffer ---> (缓存大小,建议在1K以上)</br>
|
||
|
||
<div>
|
||
<img src = "./imagesrc/hc08_CodeTree.png" alt="hc08_CodeTree" width =300 >
|
||
</div> |