mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-16 17:18:56 +00:00
620 lines
83 KiB
HTML
620 lines
83 KiB
HTML
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" data-whc_version="26.1">
|
||
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="description" content="通用异步收发传输器(Universal Asynchronous Receiver/Transmitter),通常称作 UART,是一种通用串行数据总线。 串行通信是指利用一条传输线将数据一位位地顺序传送,通信线路非常简单。 UART 为双向通信,可以实现全双工传输和接收。在嵌入式设计中,UART 用于主机与辅助设备通信,如汽车音响与外接 AP 之间的通信,也用于 PC ..."/><meta name="DC.rights.owner" content="(C) 版权 2025"/><meta name="copyright" content="(C) 版权 2025"/><meta name="generator" content="DITA-OT"/><meta name="DC.type" content="concept"/><meta name="DC.relation" content="../../../topics/chapter-title/chapter-interface-sdk.html"/><meta name="DC.relation" content="../../../topics/sdk/spi/spi_faq.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_config_lite.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_config_lite.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_debug_lite.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_test_lite.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_design_lite.html"/><meta name="DC.relation" content="../../../topics/sdk/uart/uart_faq.html"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.date.modified" content="2025-05-16"/><meta name="DC.format" content="HTML5"/><meta name="DC.identifier" content="uart_user_guide"/><meta name="DC.language" content="zh-CN"/><title>UART 使用指南</title><!-- Generated with build number 2025051600. --><meta name="wh-path2root" content="../../../"/><meta name="wh-toc-id" content="uart_user_guide-d3752e6561"/><meta name="wh-source-relpath" content="topics/sdk/uart/uart_user_guide.dita"/><meta name="wh-out-relpath" content="topics/sdk/uart/uart_user_guide.html"/>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/commons.css?buildId=2024041900"/>
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/topic.css?buildId=2024041900"/>
|
||
|
||
<script src="../../../webhelp/app/options/properties.js?buildId=20250519091401"></script>
|
||
<script src="../../../webhelp/app/localization/strings.js?buildId=2024041900"></script>
|
||
<script src="../../../webhelp/app/search/index/keywords.js?buildId=20250519091401"></script>
|
||
<script defer="defer" src="../../../webhelp/app/commons.js?buildId=2024041900"></script>
|
||
<script defer="defer" src="../../../webhelp/app/topic.js?buildId=2024041900"></script>
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-styles-web-internal.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/notes.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-common.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-images.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/footnote.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-highlight-changes.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/search-in-header.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/topic-body-list.css?buildId=2024041900"/></head>
|
||
|
||
<body id="uart_user_guide" class="wh_topic_page frmBody">
|
||
<a href="#wh_topic_body" class="sr-only sr-only-focusable">
|
||
跳转到主要内容
|
||
</a>
|
||
|
||
|
||
|
||
|
||
<header class="navbar navbar-default wh_header">
|
||
<div class="container-fluid">
|
||
<div xmlns:whc="http://www.oxygenxml.com/webhelp/components" class="wh_header_flex_container navbar-nav navbar-expand-md navbar-dark">
|
||
<div class="wh_logo_and_publication_title_container">
|
||
<div class="wh_logo_and_publication_title">
|
||
|
||
<a href="https://www.artinchip.com" class=" wh_logo d-none d-sm-block "><img src="../../../company-logo.png" alt=" RTOS SDK 使用指南 SDK 指南文件 "/></a>
|
||
<div class=" wh_publication_title "><a href="../../../index.html"><span class="booktitle"> <span class="ph mainbooktitle">RTOS SDK 使用指南</span> <span class="ph booktitlealt">SDK 指南文件</span> </span></a></div>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<div class="wh_top_menu_and_indexterms_link collapse navbar-collapse" id="wh_top_menu_and_indexterms_link">
|
||
|
||
|
||
|
||
|
||
</div>
|
||
<div class=" wh_search_input navbar-form wh_topic_page_search search " role="form">
|
||
|
||
|
||
|
||
<form id="searchForm" method="get" role="search" action="../../../search.html"><div><input type="search" placeholder="搜索 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"/><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form>
|
||
|
||
|
||
|
||
</div></div>
|
||
</div>
|
||
</header>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="container-fluid" id="wh_topic_container">
|
||
<div class="row">
|
||
|
||
<nav class="wh_tools d-print-none navbar-expand-md" aria-label="Tools">
|
||
|
||
<div data-tooltip-position="bottom" class=" wh_breadcrumb "><ol class="d-print-none"><li><span class="home"><a href="../../../index.html"><span>主页</span></a></span></li><li><div class="topicref" data-id="id"><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div></li><li><div class="topicref" data-id="concept_nww_hzh_pzb"><div class="title"><a href="../../../topics/chapter-title/chapter-interface-sdk.html">接口</a><div class="wh-tooltip"><p class="shortdesc">CAN<span class="ph">、CAP</span>、CIR、GPAI、GPIO、I2C、PSADC、PWM 等接口模块的介绍和使用说明。</p></div></div></div></li><li class="active"><div class="topicref" data-id="uart_user_guide"><div class="title"><a href="../../../topics/sdk/uart/uart_user_guide.html">UART 使用指南</a></div></div></li></ol></div>
|
||
|
||
|
||
|
||
<div class="wh_right_tools">
|
||
<button class="wh_hide_highlight" aria-label="切换搜索突出显示" title="切换搜索突出显示"></button>
|
||
<button class="webhelp_expand_collapse_sections" data-next-state="collapsed" aria-label="折叠截面" title="折叠截面"></button>
|
||
<div class=" wh_navigation_links "><span id="topic_navigation_links" class="navheader">
|
||
|
||
<span class="navprev"><a class="- topic/link link" href="../../../topics/sdk/spi/spi_faq.html" title="常见问题" aria-label="上一主题: 常见问题" rel="prev"></a></span>
|
||
<span class="navnext"><a class="- topic/link link" href="../../../topics/sdk/uart/uart_config_lite.html" title="参数配置" aria-label="下一主题: 参数配置" rel="next"></a></span> </span></div>
|
||
|
||
|
||
|
||
<div class=" wh_print_link print d-none d-md-inline-block "><button onClick="window.print()" title="打印此页" aria-label="打印此页"></button></div>
|
||
|
||
<button type="button" id="wh_toc_button" class="custom-toggler navbar-toggler collapsed wh_toggle_button navbar-light" aria-expanded="false" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
</div>
|
||
|
||
</nav>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<div class="wh_content_area">
|
||
<div class="row">
|
||
|
||
<nav id="wh_publication_toc" class="col-lg-3 col-md-3 col-sm-12 d-md-block d-none d-print-none" aria-label="Table of Contents Container">
|
||
<div id="wh_publication_toc_content">
|
||
|
||
<div class=" wh_publication_toc " data-tooltip-position="right"><span class="expand-button-action-labels"><span id="button-expand-action" role="button" aria-label="Expand"></span><span id="button-collapse-action" role="button" aria-label="Collapse"></span><span id="button-pending-action" role="button" aria-label="Pending"></span></span><ul role="tree" aria-label="Table of Contents"><li role="treeitem"><div data-tocid="revinfo_linux-d3752e463" class="topicref" data-id="revinfo_linux" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/revinfo/revinfo_rtos.html" id="revinfo_linux-d3752e463-link">修订记录</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e480" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e480-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/env/sdk-compile.html" id="id-d3752e480-link">SDK 编译</a><div class="wh-tooltip"><p class="shortdesc">介绍不同编译环境下 SDK 的详细编译流程。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e604" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e604-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/advanced/sdk-usage.html" id="id-d3752e604-link">使用指南</a><div class="wh-tooltip"><p class="shortdesc">命令详解,编译选项,镜像和分区配置,添加应用和驱动等的详细使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_rcx_czh_pzb-d3752e1004" class="topicref" data-id="concept_rcx_czh_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_rcx_czh_pzb-d3752e1004-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-app.html" id="concept_rcx_czh_pzb-d3752e1004-link">应用场景</a><div class="wh-tooltip"><p class="shortdesc">描述了 SDK 在不同应用场景中的配置和使用,包括系统更新、OTA、安全方案等。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e1848" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e1848-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/peripheral/peripheral-intro.html" id="id-d3752e1848-link">外设移植</a><div class="wh-tooltip"><p class="shortdesc"><span class="ph">CTP、U 盘、SD 卡、有线和无线网络</span>等外设的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e2022" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e2022-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/bringup/chapter-bringup.html" id="id-d3752e2022-link">BringUp</a><div class="wh-tooltip"><p class="shortdesc">主要描述板卡的各项配置,使 SDK 的环境和板卡匹配,并确保 SDK 编译后的固件能够在板子上正常运行。</p></div></div></div></li><li role="treeitem" aria-expanded="true"><div data-tocid="id-d3752e2418" class="topicref" data-id="id" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action id-d3752e2418-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html" id="id-d3752e2418-link">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem" aria-expanded="false"><div data-tocid="_0-d3752e2435" class="topicref" data-id="_0" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action _0-d3752e2435-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/lite_boot_direct.html" id="_0-d3752e2435-link">启动引导</a><div class="wh-tooltip"><p class="shortdesc">启动引导程序 Bootloader 可以实现加载启动应用程序、 烧录和升级功能。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-system-d3752e2619" class="topicref" data-id="chapter-system" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-system-d3752e2619-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-system.html" id="chapter-system-d3752e2619-link">系统</a><div class="wh-tooltip"><p class="shortdesc"></p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-memory-d3752e3709" class="topicref" data-id="chapter-memory" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-memory-d3752e3709-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-memory-sdk.html" id="chapter-memory-d3752e3709-link">存储</a><div class="wh-tooltip"><p class="shortdesc">SDMC、<span class="ph">PSRAM、</span>SPI NAND、SPI NOR 等存储模块的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_mcc_32s_nbc-d3752e4043" class="topicref" data-id="concept_mcc_32s_nbc" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_mcc_32s_nbc-d3752e4043-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-multi-media-sdk.html" id="concept_mcc_32s_nbc-d3752e4043-link">多媒体</a><div class="wh-tooltip"><p class="shortdesc">GE、VE、Display、DVP、MPP、MPP 播放器等多媒体模块的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="true"><div data-tocid="concept_nww_hzh_pzb-d3752e5544" class="topicref" data-id="concept_nww_hzh_pzb" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action concept_nww_hzh_pzb-d3752e5544-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-interface-sdk.html" id="concept_nww_hzh_pzb-d3752e5544-link">接口</a><div class="wh-tooltip"><p class="shortdesc">CAN<span class="ph">、CAP</span>、CIR、GPAI、GPIO、I2C、PSADC、PWM 等接口模块的介绍和使用说明。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem" aria-expanded="false"><div data-tocid="can-d3752e5564" class="topicref" data-id="can" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action can-d3752e5564-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/can/can_user_guide.html" id="can-d3752e5564-link">CAN 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e5648" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e5648-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/cap/cap_user_guide.html" id="id-d3752e5648-link">CAP 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e5718" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e5718-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/qep/qep_user_guide.html" id="id-d3752e5718-link">QEP 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="cir-d3752e5802" class="topicref" data-id="cir" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action cir-d3752e5802-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/cir/cir_user_guide.html" id="cir-d3752e5802-link">CIR 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="gpai-user-guide-d3752e5928" class="topicref" data-id="gpai-user-guide" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action gpai-user-guide-d3752e5928-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/gpai/gpai_user_guide.html" id="gpai-user-guide-d3752e5928-link">GPAI 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e6012" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e6012-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/gpio/gpio_user_guide.html" id="id-d3752e6012-link">GPIO 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="i2c_user_guide-d3752e6096" class="topicref" data-id="i2c_user_guide" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action i2c_user_guide-d3752e6096-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/i2c/i2c_user_guide.html" id="i2c_user_guide-d3752e6096-link">I2C 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e6208" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e6208-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/psadc/psadc_user_guide.html" id="id-d3752e6208-link">PSADC 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e6292" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e6292-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/pwm/pwm_user_guide.html" id="id-d3752e6292-link">PWM 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="rtp-user-guide-d3752e6376" class="topicref" data-id="rtp-user-guide" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action rtp-user-guide-d3752e6376-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/rtp/rtp_user_guide.html" id="rtp-user-guide-d3752e6376-link">RTP 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="spi-d3752e6475" class="topicref" data-id="spi" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action spi-d3752e6475-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/spi/spi_user_guide.html" id="spi-d3752e6475-link"><span class="ph">Q</span>SPI 使用指南</a></div></div></li><li role="treeitem" aria-expanded="true" class="active"><div data-tocid="uart_user_guide-d3752e6561" class="topicref" data-id="uart_user_guide" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action uart_user_guide-d3752e6561-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_user_guide.html" id="uart_user_guide-d3752e6561-link">UART 使用指南</a></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem"><div data-tocid="id-d3752e6575" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_config_lite.html" id="id-d3752e6575-link">参数配置</a></div></div></li><li role="treeitem"><div data-tocid="id-d3752e6589" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_debug_lite.html" id="id-d3752e6589-link">调试指南</a></div></div></li><li role="treeitem"><div data-tocid="id-d3752e6603" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_test_lite.html" id="id-d3752e6603-link">测试指南</a></div></div></li><li role="treeitem"><div data-tocid="id-d3752e6617" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_design_lite.html" id="id-d3752e6617-link">设计说明</a></div></div></li><li role="treeitem"><div data-tocid="uart_common_issues-d3752e6631" class="topicref" data-id="uart_common_issues" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/uart/uart_faq.html" id="uart_common_issues-d3752e6631-link">常见问题</a></div></div></li></ul></li><li role="treeitem" aria-expanded="false"><div data-tocid="usb_user_guide-d3752e6645" class="topicref" data-id="usb_user_guide" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action usb_user_guide-d3752e6645-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/usb/usb_user_guide.html" id="usb_user_guide-d3752e6645-link">USB 使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e6715" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e6715-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/mac/mac_user_guide.html" id="id-d3752e6715-link">MAC 使用指南</a></div></div></li></ul></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-safety-d3752e6799" class="topicref" data-id="chapter-safety" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-safety-d3752e6799-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-safety-sdk.html" id="chapter-safety-d3752e6799-link">安全</a><div class="wh-tooltip"><p class="shortdesc">SPI ENC、CE、eFuse 等安全模块的介绍和使用说明。</p></div></div></div></li></ul></li></ul></div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
|
||
<div class="col-lg-7 col-md-9 col-sm-12" id="wh_topic_body">
|
||
<button id="wh_close_publication_toc_button" class="close-toc-button d-none" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc" aria-expanded="true">
|
||
<span class="close-toc-icon-container">
|
||
<span class="close-toc-icon"></span>
|
||
</span>
|
||
</button>
|
||
<button id="wh_close_topic_toc_button" class="close-toc-button d-none" aria-label="Toggle topic table of content" aria-controls="wh_topic_toc" aria-expanded="true">
|
||
<span class="close-toc-icon-container">
|
||
<span class="close-toc-icon"></span>
|
||
</span>
|
||
</button>
|
||
|
||
<div class=" wh_topic_content body "><main role="main"><article class="- topic/topic concept/concept topic concept" role="article" aria-labelledby="ariaid-title1">
|
||
<span class="edit-link" style="font-size:12px; opacity:0.6; text-align:right; vertical-align:middle"><a target="_blank" href="http://aicdocco/taskstopics/sdk/uart/uart_user_guide.dita">Edit online</a></span><h1 class="- topic/title title topictitle1" id="ariaid-title1">UART 使用指南</h1>
|
||
|
||
<div class="date inPage">16 May 2025</div><div style="color: gray;">
|
||
Read time: 5 minute(s)
|
||
</div>
|
||
<div class="- topic/body concept/conbody body conbody">
|
||
<p class="- topic/p p" data-ofbid="d64323e33__20250519091509">通用异步收发传输器(Universal Asynchronous Receiver/Transmitter),通常称作 UART,是一种通用串行数据总线。</p>
|
||
<p class="- topic/p p" data-ofbid="d64323e36__20250519091509">串行通信是指利用一条传输线将数据一位位地顺序传送,通信线路非常简单。</p>
|
||
<p class="- topic/p p" data-ofbid="d64323e39__20250519091509">UART 为双向通信,可以实现全双工传输和接收。在嵌入式设计中,UART 用于主机与辅助设备通信,如汽车音响与外接 AP 之间的通信,也用于 PC
|
||
机通信包括与监控调试器和其它器件,如 EEPROM 通信。</p>
|
||
<p class="- topic/p p" data-ofbid="d64323e42__20250519091509">在 UART 上追加同步方式的序列信号变换电路的产品,被称为 USART (Universal Synchronous Asynchronous Receiver
|
||
Transmitter)。</p>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="uart_user_guide__table_eny_3yy_21c" data-ofbid="uart_user_guide__table_eny_3yy_21c" data-cols="3"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label">表<span class="table--title-label-number"> 1</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">术语定义</span></caption><colgroup><col style="width:21.69197396963124%"/><col style="width:42.51626898047723%"/><col style="width:35.791757049891544%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e63__20250519091509">术语</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e67__20250519091509">定义</p></th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-1" id="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e71__20250519091509">注释说明</p></th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e81__20250519091509">UART</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e85__20250519091509">Universal Asynchronous Receiver/Transmitter</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e89__20250519091509">通用异步收发传输器</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e96__20250519091509">TTL</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e100__20250519091509">Transistor-Transistor Logic</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e104__20250519091509">逻辑门电路</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e111__20250519091509">DCD</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e115__20250519091509">Data Carrier Detect</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e119__20250519091509">载波侦听</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e126__20250519091509">DTR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e130__20250519091509">Data Terminal Ready</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e134__20250519091509">数据终端准备好</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e141__20250519091509">DSR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e145__20250519091509">Data Set Ready</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e149__20250519091509">数据准备好</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e157__20250519091509">RTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e161__20250519091509">Request To Send</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e165__20250519091509">请求发送</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e172__20250519091509">CTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e176__20250519091509">Clear To Send</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e180__20250519091509">清除发送</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e187__20250519091509">RI</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e191__20250519091509">Ring Indicator</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e195__20250519091509">响铃指示</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e202__20250519091509">THR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e206__20250519091509">Transmit Holding Register</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e210__20250519091509">发送保持寄存器</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e217__20250519091509">RBR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e221__20250519091509">Receive Buffer Register</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e225__20250519091509">接收缓冲寄存器</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_eny_3yy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e232__20250519091509">ACPI</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_eny_3yy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e236__20250519091509">Advanced Configuration and Power Interface</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="uart_user_guide__table_eny_3yy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e240__20250519091509">高阶配置和电源接口</p></td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
<section class="- topic/section section" id="uart_user_guide__id12" data-ofbid="uart_user_guide__id12"><h2 class="- topic/title title sectiontitle">模块特性</h2>
|
||
|
||
<ul class="- topic/ul ul simple" id="uart_user_guide__ul_qj4_btm_fdc" data-ofbid="uart_user_guide__ul_qj4_btm_fdc">
|
||
<li class="- topic/li li" data-ofbid="d64323e255__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e257__20250519091509">兼容工业标准 16550 UART</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e261__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e263__20250519091509">256x8bit 发送与接收 FIFO</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e267__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e269__20250519091509">传输速度可达 3 Mbps</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e273__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e275__20250519091509">支持 5-8 数据位以及 1/1 ½/2 停止位</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e279__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e281__20250519091509">支持奇校验,偶校验或者无奇偶校验</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e286__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e288__20250519091509">支持 DMA 控制器接口</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e292__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e294__20250519091509">支持软件/硬件流控</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e298__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e300__20250519091509">支持 IrDA 1.0 SIR</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e304__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e306__20250519091509">支持 RS-485/9bit 模式</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e310__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e312__20250519091509">RS-485 支持硬件使能</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e316__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e318__20250519091509">Compact-IO 精简 2 线模式</p>
|
||
</li>
|
||
</ul>
|
||
</section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_wll_lyy_21c" data-ofbid="uart_user_guide__section_wll_lyy_21c"><h2 class="- topic/title title sectiontitle">通信协议</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d64323e329__20250519091509">UART 作为异步串行通信协议的一种,工作原理是将传输数据的每个字符一位接一位地传输。其协议中添加了一些特殊的表示位:</p>
|
||
<ul class="- topic/ul ul" id="uart_user_guide__ul_zfw_qgp_ybc" data-ofbid="uart_user_guide__ul_zfw_qgp_ybc">
|
||
<li class="- topic/li li" data-ofbid="d64323e334__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_agw_qgp_ybc" data-ofbid="uart_user_guide__dl_agw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e340__20250519091509">起始位 Start bit</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e345__20250519091509">先发出一个逻辑“0”的信号,表示传输字符的开始</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e352__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_bgw_qgp_ybc" data-ofbid="uart_user_guide__dl_bgw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e358__20250519091509">数据位 Data bits</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e363__20250519091509">紧接着起始位之后。数据位的个数可以是 4、5、6、7、8 等,构成一个字符。通常采用 ASCII
|
||
码。从最低位开始传送,靠时钟定位。</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e370__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_cgw_qgp_ybc" data-ofbid="uart_user_guide__dl_cgw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e376__20250519091509">奇偶校验位 Parity</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e381__20250519091509">数据位加上这一位后,使得“1”的位数应为偶数(偶校验)或奇数(奇校验),以此来校验数据传送的正确性。</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e388__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_dgw_qgp_ybc" data-ofbid="uart_user_guide__dl_dgw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e394__20250519091509">停止位 Stop bits</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e399__20250519091509">它是一个字符数据的结束标志。可以是 1 位、1.5 位、2 位的高电平。
|
||
由于数据是在传输线上定时的,并且每一个设备有其自己的时钟,很可能在通信中两台设备间出现了小小的不同步。因此停止位不仅仅是表示传输的结束,并且提供计算机校正时钟同步的机会。停止位的位数越多,时钟同步的容忍程度越大,但是数据传输率会越慢</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e406__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_egw_qgp_ybc" data-ofbid="uart_user_guide__dl_egw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e412__20250519091509">流控 Flow contorl</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e417__20250519091509">管理两个节点之间数据传输速率的过程,以防止出现接收端的数据缓冲区已满,而发送端依然继续发送数据,所导致数据丢失,我们会在一些上位机上看到
|
||
RTS /CTS、DTR /DSR 和 XON /XOFF 的选项,这是对流控制的选项</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e425__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_fgw_qgp_ybc" data-ofbid="uart_user_guide__dl_fgw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e431__20250519091509">空闲位</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e436__20250519091509">处于逻辑“1”状态,表示当前线路上没有数据传送,该位为协议位,自动产生</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e443__20250519091509">
|
||
<dl class="- topic/dl dl" id="uart_user_guide__dl_ggw_qgp_ybc" data-ofbid="uart_user_guide__dl_ggw_qgp_ybc">
|
||
|
||
<dt class="- topic/dt dt dlterm" data-ofbid="d64323e449__20250519091509">波特率 BaudRate</dt>
|
||
<dd class="- topic/dd dd">
|
||
<p class="- topic/p p" data-ofbid="d64323e454__20250519091509">是衡量数据传送速率的指标。表示每秒钟传送的 bit 数。比如波特率 115200,表示传输速率是 115200 bps</p>
|
||
</dd>
|
||
|
||
</dl>
|
||
</li>
|
||
</ul>
|
||
<ul class="- topic/ul ul simple" id="uart_user_guide__ul_aj4_btm_fdc" data-ofbid="uart_user_guide__ul_aj4_btm_fdc">
|
||
<li class="- topic/li li" data-ofbid="d64323e464__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e466__20250519091509">串口、COM 口是指的物理接口形式(硬件)。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e470__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e472__20250519091509">TTL、RS-232、RS-485 是指的电平标准(电信号)。</p>
|
||
</li>
|
||
</ul>
|
||
</section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_fml_lyy_21c" data-ofbid="uart_user_guide__section_fml_lyy_21c"><h2 class="- topic/title title sectiontitle">参数信息</h2><p class="- topic/p p" data-ofbid="d64323e481__20250519091509">在 UART
|
||
进行通信的时候,双方需要协商相关参数,否则无法进行信息解析,因此在通信之初,需要对所使用的工具设置上述的所有参数</p><div class="- topic/p p" data-ofbid="d64323e483__20250519091509"><br/><div class="imagecenter"><img class="- topic/image image imagecenter" id="uart_user_guide__image_gml_lyy_21c" src="../../../images/uart/uart-param.jpg" alt="uart-param1"/></div><br/></div></section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_qvz_tyy_21c" data-ofbid="uart_user_guide__section_qvz_tyy_21c"><h2 class="- topic/title title sectiontitle">常用接口</h2>
|
||
|
||
<div class="- topic/p p" data-ofbid="d64323e495__20250519091509">串口、COM 口是指的物理接口形式(硬件)。TTL、RS-232、RS-485 是指的电平标准(电信号)。<ul class="- topic/ul ul" id="uart_user_guide__ul_pj4_vyy_21c" data-ofbid="uart_user_guide__ul_pj4_vyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e499__20250519091509">TTL<ul class="- topic/ul ul" id="uart_user_guide__ul_iml_lyy_21c" data-ofbid="uart_user_guide__ul_iml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e503__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e505__20250519091509">TTL 标准是低电平(0V)为 0,高电平(+5V)为 1。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e509__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e511__20250519091509">TTL 接口需要对端接口也为 TTL,但诸如 PC 等设备无 TTL 接口的 UART 口,一般转 TTL 为 USB 等 PC
|
||
更通用的接口。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e515__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e517__20250519091509">TTL 接口为全双工,连接设备的时候一般只接 GND/RX/TX。不会接 Vcc 或者 +3.3v
|
||
的电源线,避免与目标设备上的供电冲突,但 GND 可以保证源设备和目标设备供地,有助于信号稳定。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e521__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e523__20250519091509">信号线采用交叉的方式,即源端的 RX 连接目标设备的 TX,源端的 TX 连接目标设备的 RX。</p>
|
||
</li>
|
||
</ul></li>
|
||
<li class="- topic/li li" data-ofbid="d64323e528__20250519091509">RS232<ul class="- topic/ul ul" id="uart_user_guide__ul_jml_lyy_21c" data-ofbid="uart_user_guide__ul_jml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e532__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e534__20250519091509">RS232 标准是正电平(+3V~+15V)为 0,负电平(-13V~-15V)为 1。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e538__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e540__20250519091509">RS232 接口在总线上只允许连接 1 个收发器,单站能力。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e544__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e546__20250519091509">RS232 传输线采用屏蔽双绞线,最高传输距离一般为 15M,最大速率为 20Kbps。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e550__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e552__20250519091509">RS232 接口为全双工,连接设备的时候一般只接 GND/RX/TX。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e556__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e558__20250519091509">信号线也采用交叉的方式,即源端的 RX 连接目标设备的 TX,源端的 TX 连接目标设备的 RX。</p>
|
||
</li>
|
||
</ul></li>
|
||
<li class="- topic/li li" data-ofbid="d64323e563__20250519091509">RS422<ul class="- topic/ul ul" id="uart_user_guide__ul_kml_lyy_21c" data-ofbid="uart_user_guide__ul_kml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e567__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e569__20250519091509">RS422
|
||
标准采用差分信号负逻辑,逻辑“1”以两线间的电压差为+(2—6)V 表示。逻辑“0”以两线间的电压差为-(2—6)V 表示。接口信号电平比
|
||
RS232 降低了,就不易损坏接口电路的芯片,且该电平与 TTL 电平兼容,可方便与 TTL 电路连接。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e573__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e575__20250519091509">RS422 接口在总线上是允许连接多达 128 个收发器,多站能力。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e579__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e581__20250519091509">RS422 的数据最高传输速率为 10Mbps,100 米长双绞线的最大速度为 1Mb/s。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e585__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e587__20250519091509">RS422 采用平衡发送和差分接收,因此具有抑制共模干扰的能力。RS422
|
||
接口的最大传输距离标准值为 4000 英尺(约 1219 米),实际上可达 3000 米。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e591__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e593__20250519091509">RS422 是全双工,连接设备的时候一般接 RX+/RX-/TX+/TX-/GND。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e598__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e600__20250519091509">信号线也采用交叉的方式,即源端的 RX-/RX+ 连接目标设备的 TX-/TX+,源端的 TX-/TX+ 连接目标设备的
|
||
RX-/RX+。</p>
|
||
</li>
|
||
</ul></li>
|
||
<li class="- topic/li li" data-ofbid="d64323e605__20250519091509">RS485<ul class="- topic/ul ul" id="uart_user_guide__ul_lml_lyy_21c" data-ofbid="uart_user_guide__ul_lml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e609__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e611__20250519091509">RS485 的电气性能和 RS422 完全一样,主要区别是 RS485 是半双工。连接设备的时候一般接 A-/A+/GND,DB9
|
||
接口定义了两组,同时必须使用同一组的+/-。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e615__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e617__20250519091509">信号线也采用交叉的方式,即源端的 A- 连接目标设备的 A-,源端的 A+ 连接目标设备的 A+。</p>
|
||
</li>
|
||
</ul></li>
|
||
</ul></div>
|
||
</section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_qsp_xyy_21c" data-ofbid="uart_user_guide__section_qsp_xyy_21c"><h2 class="- topic/title title sectiontitle">插头</h2><div class="- topic/p p" data-ofbid="d64323e627__20250519091509">公母之分<ul class="- topic/ul ul" id="uart_user_guide__ul_mml_lyy_21c" data-ofbid="uart_user_guide__ul_mml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e631__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e633__20250519091509">针形的为公头,孔形的为母头</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e637__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e639__20250519091509">PC 串口一般为公头,设备的一般为母头</p>
|
||
</li>
|
||
</ul></div><div class="- topic/p p" data-ofbid="d64323e643__20250519091509">
|
||
<br/><div class="imagecenter"><img class="- topic/image image imagecenter" id="uart_user_guide__image_nml_lyy_21c" src="../../../images/uart/port-male.jpg" width="288" alt="port-male1"/></div><br/>
|
||
</div> RS232DB9 的信号分分四组:<ul class="- topic/ul ul" id="uart_user_guide__ul_pml_lyy_21c" data-ofbid="uart_user_guide__ul_pml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e654__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e656__20250519091509">DCD/RI:电气 Ready 参数</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e660__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e662__20250519091509">DTR/DSR:模块 Ready 参数</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e666__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e668__20250519091509">RTS/CTS:流控参数</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d64323e672__20250519091509">
|
||
<p class="- topic/p p" data-ofbid="d64323e674__20250519091509">RXD/TXD:数据收发</p>
|
||
</li>
|
||
</ul><div class="table-container"><table class="- topic/table table frame-all" id="uart_user_guide__table_qml_lyy_21c" data-ofbid="uart_user_guide__table_qml_lyy_21c" data-cols="7"><caption></caption><colgroup><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/><col style="width:14.285714285714285%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e702__20250519091509">针序</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e706__20250519091509">RS232</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e710__20250519091509">说明</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e714__20250519091509">RS422</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e718__20250519091509">说明</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e723__20250519091509">RS485</p></th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-1" id="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e727__20250519091509">说明</p></th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e737__20250519091509">1</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e741__20250519091509">DCD</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e745__20250519091509">数据载波检测</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e749__20250519091509">RXD-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e753__20250519091509">接收</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e758__20250519091509">A-</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e762__20250519091509">组 1</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e769__20250519091509">2</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e773__20250519091509">RXD</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e777__20250519091509">接收数据</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e781__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e785__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e790__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e794__20250519091509">-</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e801__20250519091509">3</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e805__20250519091509">TXD</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e809__20250519091509">发送数据</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e813__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e817__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e822__20250519091509">-</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e826__20250519091509">-</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e833__20250519091509">4</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e837__20250519091509">DTR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e841__20250519091509">数据终端准备好</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e845__20250519091509">TXD+</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e849__20250519091509">发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e854__20250519091509">A+</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e858__20250519091509">组 2</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e865__20250519091509">5</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e869__20250519091509">GND</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e873__20250519091509">信号地</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e877__20250519091509">GND</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e881__20250519091509">信号地</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e886__20250519091509">GND</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e890__20250519091509">信号地</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e898__20250519091509">6</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e902__20250519091509">DSR</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e906__20250519091509">数据准备好</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e910__20250519091509">RXD+</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e914__20250519091509">接收</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e919__20250519091509">A+</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e923__20250519091509">组 1</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e930__20250519091509">7</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e934__20250519091509">RTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e938__20250519091509">请求发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e942__20250519091509">RTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e946__20250519091509">请求发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e951__20250519091509">RTS</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e955__20250519091509">请求发送</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e962__20250519091509">8</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e966__20250519091509">CTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e970__20250519091509">清除发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e974__20250519091509">CTS</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e978__20250519091509">清除发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e983__20250519091509">CTS</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e987__20250519091509">清除发送</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e994__20250519091509">9</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e998__20250519091509">RI</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e1002__20250519091509">响铃指示</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e1006__20250519091509">TXD-</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e1010__20250519091509">发送</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__6"><p class="- topic/p p" data-ofbid="d64323e1015__20250519091509">A-</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="uart_user_guide__table_qml_lyy_21c__entry__7"><p class="- topic/p p" data-ofbid="d64323e1019__20250519091509">组 2</p></td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
</section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_rml_lyy_21c" data-ofbid="uart_user_guide__section_rml_lyy_21c"><h2 class="- topic/title title sectiontitle">流控</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d64323e1032__20250519091509">这里讲到的
|
||
“流”,指的是数据流。在数据通信中,流控制是管理两个节点之间数据传输速率的过程,以防止出现接收端的数据缓冲区已满,而发送端依然继续发送数据,所导致数据丢失。</p>
|
||
<p class="- topic/p p" data-ofbid="d64323e1035__20250519091509">当接收端的数据缓冲区已满,无法处理数据来时,就发出 “不再接收” 的信号,发送端则停止发送,直到发送端收到 “可以继续发送” 的信号再发送数据。</p>
|
||
<div class="- topic/p p" data-ofbid="d64323e1038__20250519091509">计算机中常用的两种流控制分别是硬件流控制(RTS /CTS、DTR /DSR 等)和软件流控制(XON /XOFF)。<ul class="- topic/ul ul" id="uart_user_guide__ul_n1b_bzy_21c" data-ofbid="uart_user_guide__ul_n1b_bzy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e1042__20250519091509">硬件流控<p class="- topic/p p" data-ofbid="d64323e1044__20250519091509">RTS/CTS
|
||
属于硬件握手的一种,最初是设计为电传打字机和调制解调器半双工协作通信的,每次它只能一方调制解调器发送数据。终端必须发送请求发送信号然后等到调制解调器回应清除发送信号。</p><div class="- topic/p p" data-ofbid="d64323e1046__20250519091509">
|
||
<br/><div class="imagecenter"><img class="- topic/image image imagecenter" id="uart_user_guide__image_tml_lyy_21c" src="../../../images/uart/flowctrol.jpg" alt="flowctrol1"/></div><br/>
|
||
</div></li>
|
||
<li class="- topic/li li" data-ofbid="d64323e1055__20250519091509">软件流控<p class="- topic/p p" data-ofbid="d64323e1057__20250519091509">软件流控制(Software flow control)是在计算机数据链路中的一种流控制方法,特别适用于 RS232
|
||
串口通信。它是采用特殊字符来传输带内信令,特殊编码字符称作 XOFF 与 XON(分别表示 “transmit off” 与 “transmit
|
||
on”)。因此,也被称作 “XON /XOFF 流控制”。</p><div class="table-container"><table class="- topic/table table frame-all" id="uart_user_guide__table_vml_lyy_21c" data-ofbid="uart_user_guide__table_vml_lyy_21c" data-cols="5"><caption></caption><colgroup><col style="width:20%"/><col style="width:20%"/><col style="width:20%"/><col style="width:20%"/><col style="width:20%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_vml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e1079__20250519091509">码的名字</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_vml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e1083__20250519091509">含义</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_vml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e1087__20250519091509">ASCII</p></th>
|
||
<th class="- topic/entry entry colsep-1 rowsep-1" id="uart_user_guide__table_vml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e1091__20250519091509">十进制</p></th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-1" id="uart_user_guide__table_vml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e1095__20250519091509">十六进制</p></th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_vml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e1105__20250519091509">XOFF</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_vml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e1109__20250519091509">暂停传输</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_vml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e1113__20250519091509">DC3</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-1" headers="uart_user_guide__table_vml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e1117__20250519091509">19</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-1" headers="uart_user_guide__table_vml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e1121__20250519091509">13</p></td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_vml_lyy_21c__entry__1"><p class="- topic/p p" data-ofbid="d64323e1128__20250519091509">XON</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_vml_lyy_21c__entry__2"><p class="- topic/p p" data-ofbid="d64323e1132__20250519091509">恢复传输</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_vml_lyy_21c__entry__3"><p class="- topic/p p" data-ofbid="d64323e1136__20250519091509">DC1</p></td>
|
||
<td class="- topic/entry entry colsep-1 rowsep-0" headers="uart_user_guide__table_vml_lyy_21c__entry__4"><p class="- topic/p p" data-ofbid="d64323e1140__20250519091509">17</p></td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="uart_user_guide__table_vml_lyy_21c__entry__5"><p class="- topic/p p" data-ofbid="d64323e1144__20250519091509">11</p></td>
|
||
</tr>
|
||
</tbody></table></div><p class="- topic/p p" data-ofbid="d64323e1150__20250519091509">A 端的 DTR(数据设备就绪)发出信号, 当 B 端准备好后,B 端的 DTR(数据设备就绪)向 A 端的
|
||
DSR(通讯设备就绪)发出信号。 接下来就可以通过 RTS(请求发送)和 DTR(允许发送)来控制通信。</p></li>
|
||
</ul></div>
|
||
</section>
|
||
<section class="- topic/section section" id="uart_user_guide__section_wml_lyy_21c" data-ofbid="uart_user_guide__section_wml_lyy_21c"><h2 class="- topic/title title sectiontitle">RAW 模式</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d64323e1161__20250519091509">UART 作为 tty 设备工作时,有两种工作方式:</p>
|
||
<ul class="- topic/ul ul" id="uart_user_guide__ul_xml_lyy_21c" data-ofbid="uart_user_guide__ul_xml_lyy_21c">
|
||
<li class="- topic/li li" data-ofbid="d64323e1166__20250519091509">Canonical Input<p class="- topic/p p" data-ofbid="d64323e1168__20250519091509">RX 端接收到数据之后不会直接反馈给用户态的 read
|
||
函数,而是要一直等到一个回车,意即对一些特殊字符进行语意解析</p></li>
|
||
<li class="- topic/li li" data-ofbid="d64323e1171__20250519091509">Raw Input<p class="- topic/p p" data-ofbid="d64323e1173__20250519091509">RX 端接收到什么直接返回到用户空间的 read 函数里面</p></li>
|
||
</ul>
|
||
<p class="- topic/p p" data-ofbid="d64323e1177__20250519091509">两种工作模式均为 kernel 层逻辑,和驱动/硬件无关,对于普通的 uart 应用,建议 Canonical 方式,对于 RS485 应用,建议使用 Raw
|
||
方式,二者通过 termios 的 lflag 参数的 ICANON 位进行区分。</p>
|
||
</section>
|
||
</div>
|
||
</article></main></div>
|
||
|
||
<div class=" wh_child_links d-print-none "><nav aria-label="Child Links" role="navigation" class="- topic/related-links related-links"><ul class="ullinks"><li class="- topic/link link ulchildlink"><strong><a href="../../../topics/sdk/uart/uart_config_lite.html">参数配置</a></strong></li><li class="- topic/link link ulchildlink"><strong><a href="../../../topics/sdk/uart/uart_debug_lite.html">调试指南</a></strong></li><li class="- topic/link link ulchildlink"><strong><a href="../../../topics/sdk/uart/uart_test_lite.html">测试指南</a></strong></li><li class="- topic/link link ulchildlink"><strong><a href="../../../topics/sdk/uart/uart_design_lite.html">设计说明</a></strong></li><li class="- topic/link link ulchildlink"><strong><a href="../../../topics/sdk/uart/uart_faq.html">常见问题</a></strong></li></ul></nav></div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<nav role="navigation" id="wh_topic_toc" aria-label="On this page" class="col-lg-2 d-none d-lg-block navbar d-print-none">
|
||
<div id="wh_topic_toc_content">
|
||
|
||
<div class=" wh_topic_toc "><div class="wh_topic_label">在本页上</div><ul><li class="section-item"><div class="section-title"><a href="#uart_user_guide__id12" data-tocid="uart_user_guide__id12">模块特性</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_wll_lyy_21c" data-tocid="uart_user_guide__section_wll_lyy_21c">通信协议</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_fml_lyy_21c" data-tocid="uart_user_guide__section_fml_lyy_21c">参数信息</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_qvz_tyy_21c" data-tocid="uart_user_guide__section_qvz_tyy_21c">常用接口</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_qsp_xyy_21c" data-tocid="uart_user_guide__section_qsp_xyy_21c">插头</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_rml_lyy_21c" data-tocid="uart_user_guide__section_rml_lyy_21c">流控</a></div></li><li class="section-item"><div class="section-title"><a href="#uart_user_guide__section_wml_lyy_21c" data-tocid="uart_user_guide__section_wml_lyy_21c">RAW 模式</a></div></li></ul></div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<footer class="navbar navbar-default wh_footer">
|
||
<div class=" footer-container mx-auto ">
|
||
<title>footer def</title>
|
||
<style>
|
||
.p1 {
|
||
font-family: FangZhengShuSong, Times, serif;
|
||
}
|
||
.p2 {
|
||
font-family: Arial, Helvetica, sans-serif;
|
||
}
|
||
.p3 {
|
||
font-family: "Lucida Console", "Courier New", monospace;
|
||
}
|
||
</style>
|
||
<div class="webhelp.fragment.footer">
|
||
<p class="p1">Copyright © 2019-2025 广东匠芯创科技有限公司. All rights reserved.</p>
|
||
</div>
|
||
<div>
|
||
<div class="generation_time">
|
||
Update Time: 2025-05-19
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</footer>
|
||
|
||
<div id="go2top" class="d-print-none">
|
||
<span class="oxy-icon oxy-icon-up"></span>
|
||
</div>
|
||
|
||
<div id="modal_img_large" class="modal">
|
||
<span class="close oxy-icon oxy-icon-remove"></span>
|
||
<div id="modal_img_container"></div>
|
||
<div id="caption"></div>
|
||
</div>
|
||
|
||
|
||
<script src="${pd}/publishing/publishing-styles-AIC-template/js/custom.js" defer="defer"></script>
|
||
|
||
|
||
</body>
|
||
</html> |