linux下USB转串口配置

回眸只為那壹抹淺笑 提交于 2020-12-19 11:13:19

https://www.cnblogs.com/shishiteng/p/5801826.html

https://blog.csdn.net/kevinhg/article/details/6930333

https://blog.csdn.net/fhqlongteng/article/details/80417028

<div class="post"> <h1 class="postTitle"> <a id="cb_post_title_url" class="postTitle2" href="https://www.cnblogs.com/shishiteng/p/5801826.html">minicom-linux下USB转串口配置</a> </h1> <div class="clear"></div> <div class="postBody"> <div id="cnblogs_post_body" class="blogpost-body"><div style="white-space: pre-wrap; line-height: 1.5; font-size: 14px;">现在的笔记本越做越薄,好些电脑已经没有串口了,做硬件开发会非常头疼,不过有了USB转串口设备,PC机只需要有USB接口就可以了。在linux下我们使用minicom与目标设备通信,在此记录一下linux下USB转串口的配置过程。</div> <p>&nbsp;</p> <p>&nbsp;<strong>1.查看驱动是否正常</strong>:</p> <div class="cnblogs_code"> <pre>sst@ubuntu:~/work/test$ <span style="color: #0000ff;">lsmod</span> |<span style="color: #0000ff;">grep</span><span style="color: #000000;"> usbserial <br>usbserial </span><span style="color: #800080;">45014</span> <span style="color: #800080;">1</span> ch341</pre> </div> <p>如果有usbserial这一行,说明系统支持USB转串口。</p> <p>&nbsp;</p> <p><strong>2.查看USB设备</strong></p> <div class="cnblogs_code"> <pre>sst@ubuntu:~/work/test$ dmesg |<span style="color: #0000ff;">grep</span><span style="color: #000000;"> ttyUSB0<br> [</span><span style="color: #800080;">221102.440589</span>] usb <span style="color: #800080;">3</span>-<span style="color: #800080;">10</span>: ch341-uart converter now attached to ttyUSB0</pre> </div> <p>&nbsp;</p> <p><strong>3.安装minicom</strong></p> <div class="cnblogs_code"> <pre><span style="color: #0000ff;">sudo</span> apt-get <span style="color: #0000ff;">install</span> minicom</pre> </div> <p>&nbsp;</p> <p><strong>4.配置minicom</strong></p> <div class="cnblogs_code"> <pre><span style="color: #0000ff;">sudo</span> minicom -s</pre> </div> <p><img src="https://images2015.cnblogs.com/blog/985736/201608/985736-20160824101036495-1302763821.png" alt=""></p> <p><span style="text-indent: 28px; line-height: 1.5; font-size: 14px;"><span style="text-indent: 28px; line-height: 1.5; font-size: 14px;"><span style="text-indent: 28px; line-height: 1.5; font-size: 14px;">  按A键,设置Serial Device为: /dev/ttyUSB0</span></span></span></p> <p>按F键,设置Hardware Flow Control 为No</p> <p>按G键,设置Software Flow Control为No</p> <p>按回车,保存。</p> <p>如果想把你的配置设置为默认配置,在configuration选择Save setup as dfl,然后退出。</p> <p>&nbsp;</p> <p><strong>5.启动minicom</strong></p> <div class="cnblogs_code"> <pre><span style="color: #0000ff;">sudo</span> minicon</pre> </div> <p><img style="width: 1852.38px;" src="http://note.youdao.com/yws/res/7031/WEBRESOURCEd7fb1479d4a9e36ff66ff35491e7afa8" alt="" data-media-type="image"></p> <p>&nbsp;</p> <p>我的串口输出是二进制数据,所以看上去就是乱码啦按下CTRL-A Z后会弹出帮助菜单,在菜单下按Q可以退出。</p> <p>&nbsp;</p> <p><img src="https://images2015.cnblogs.com/blog/985736/201608/985736-20160824100923901-1768836477.png" alt=""></p> <p>&nbsp;</p></div><div id="MySignature"></div> <div class="clear"></div> <div id="blog_post_info_block"> <div id="BlogPostCategory">分类: <a href="http://www.cnblogs.com/shishiteng/category/866128.html" target="_blank">Linux</a></div> <div id="EntryTag"></div> <div id="blog_post_info"><div id="green_channel"> <a href="javascript:void(0);" id="green_channel_digg" onclick="DiggIt(5801826,cb_blogId,1);green_channel_success(this,'谢谢推荐!');">好文要顶</a> <a id="green_channel_follow" onclick="follow('0f24780b-283f-e611-9fc1-ac853d9f53cc');" href="javascript:void(0);">关注我</a> <a id="green_channel_favorite" onclick="AddToWz(cb_entryId);return false;" href="javascript:void(0);">收藏该文</a> <a id="green_channel_weibo" href="javascript:void(0);" title="分享至新浪微博" onclick="ShareToTsina()"><img src="//common.cnblogs.com/images/icon_weibo_24.png" alt=""></a> <a id="green_channel_wechat" href="javascript:void(0);" title="分享至微信" onclick="shareOnWechat()"><img src="//common.cnblogs.com/images/wechat.png" alt=""></a> </div> <div id="author_profile"> <div id="author_profile_info" class="author_profile_info"> <a href="http://home.cnblogs.com/u/shishiteng/" target="_blank"><img src="//pic.cnblogs.com/face/985736/20160701091114.png" class="author_avatar" alt=""></a> <div id="author_profile_detail" class="author_profile_info"> <a href="http://home.cnblogs.com/u/shishiteng/">shishiteng</a><br> <a href="http://home.cnblogs.com/u/shishiteng/followees">关注 - 4</a><br> <a href="http://home.cnblogs.com/u/shishiteng/followers">粉丝 - 1</a> </div> </div> <div class="clear"></div> <div id="author_profile_honor"></div> <div id="author_profile_follow"> <a href="javascript:void(0);" onclick="follow('0f24780b-283f-e611-9fc1-ac853d9f53cc');return false;">+加关注</a> </div> </div> <div id="div_digg"> <div class="diggit" onclick="votePost(5801826,'Digg')"> <span class="diggnum" id="digg_count">0</span> </div> <div class="buryit" onclick="votePost(5801826,'Bury')"> <span class="burynum" id="bury_count">0</span> </div> <div class="clear"></div> <div class="diggword" id="digg_tips"> </div> </div> <script type="text/javascript"> currentDiggType = 0; </script></div> <div class="clear"></div> <div id="post_next_prev"><a href="http://www.cnblogs.com/shishiteng/p/5799500.html" class="p_n_p_prefix">« </a> 上一篇:<a href="http://www.cnblogs.com/shishiteng/p/5799500.html" title="发布于2016-08-23 15:18">ORB_SLAM2 闭环检测段错误</a><br><a href="http://www.cnblogs.com/shishiteng/p/5995644.html" class="p_n_p_prefix">» </a> 下一篇:<a href="http://www.cnblogs.com/shishiteng/p/5995644.html" title="发布于2016-10-25 10:12">ORB_SLAM2 Tracking流程</a><br></div> </div>

	</div>
	<div class="postDesc">posted @ <span id="post-date">2016-08-24 10:20</span> <a href="http://www.cnblogs.com/shishiteng/">shishiteng</a> 阅读(<span id="post_view_count">1581</span>) 评论(<span id="post_comment_count">0</span>)  <a href="https://i.cnblogs.com/EditPosts.aspx?postid=5801826" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(5801826);return false;">收藏</a></div>
</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!