更改

跳转至: 导航搜索

Orange Pi 3B

添加473字节, 2023年8月3日 (四) 10:47
40pin的UART测试
<li><p>由下表可知,Orange Pi 3B可用的uart为uart3、uart7和uart9共三组uart总线</p>
<p>[[File:media/image270.png|575x160px]]</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''从上表中可以看到,i2c3_m0和uart3_m0是引脚复用的,两者不能同时打开'''</p></big>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''在linux系统中,40pin中的uart默认都是关闭的,需要手动打开才能使用。'''</p>  
<p>'''在/boot/orangepiEnv.txt中加入下面红色字体部分的配置,然后重启Linux系统就可以同时打开uart3、uart7、和uart9,如果只需要打开一个,那么就填写一个即可。'''</p>
 
 
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>'''<span style="color:#FF0000">overlays=uart3-m0 uart7-m2 uart9-m2</span>'''</p></big>|}</li>
<li><p>进入linux系统后,先确认下/dev下是否存在对应uart的设备节点</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~# '''ls /dev/ttyS*'''</p>
<p>/dev/ttyS1 '''/dev'''/'''ttyS3 /dev/ttyS7 /dev/ttyS9'''</p>|}</li>
<li><p>然后开始测试uart接口,先使用杜邦线短接要测试的uart接口的rx和tx</p></li></ol>
{| class="wikitable" style="width:800px;text-align:center;"
|-
|
<ol style="list-style-type: lower-alpha;">
<li><p>测试UART3</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device \'''</p>
<p>'''&quot;/dev/ttyS3&quot;'''</p>
 
 
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4:^C</p>
<p>exit</p>|}</li>
<li><p>测试UART7</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device \'''</p>
<p>'''&quot;/dev/ttyS7&quot;'''</p>
 
 
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4:^C</p>
<p>exit</p>|}</li>
<li><p>测试UART9</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device \'''</p>
<p>'''&quot;/dev/ttyS9&quot;'''</p>
 
 
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4:^C</p>
<p>exit</p>|}</li></ol>
</li></ol>
8,460
个编辑

导航菜单