⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 3839.htm

📁 Labview 访问2线制数据i2C
💻 HTM
📖 第 1 页 / 共 2 页
字号:
 																																																											        <!-- set statbox vars --->                      <html><head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'><title>运用LabView控制DS3900串口通信模块 - Maxim</title><meta name="keywords" content="DS3900,  LabView,  I2C,  串口"><meta name="description" content="LabView is popular as a graphical programming platform for developing embedded applications. The DS3900 is a general purpose interface board used for communicating with devices equipped with the I2C interface using the PCs serial port. The DS3900 has"><link rel=stylesheet href="/newstyles.css" type="text/css"></head><body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"><!-- ================================================================== --><!-- BEGIN: SITE HEADER --><!-- ================================================================== --><!-- BEGIN: LEFT WING --><table border=0 cellspacing=0 cellpadding=0 width=100% height=100%><tr valign="top"><td bgcolor=#F4F4F4><img width="1" height="3" src="http://www.maxim-ic.com.cn/maxkit/dots/clear_dot.gif"><br><table border=0 cellspacing=0 cellpadding=0 align="center" width=600><tr><td bgcolor=#C8C8C8><table border=0 cellspacing=1 cellpadding=0><tr><td bgcolor="white"><!-- END: LEFT WING --><!-- BEGIN: META CONTROL --><table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor=#7386A5><tr valign="top">    <!-- METASITE CONTROL -->    <td align="left">	<nobr>&nbsp;</nobr>    </td>    <td>&nbsp;</td>    <td align="right">	<!-- LANG_SWITCH: keep this include all on one line by itself -->	<nobr>&nbsp;<a class="header_nav" href="http://www.maxim-ic.com/appnotes.cfm?an_pk=3839">&#69;&#78;&#71;&#76;&#73;&#83;&#72;</a><font color="#D0D0D0">&#8226;</font><a class="header_nav" href="http://www.maxim-ic.com.cn/appnotes.cfm?an_pk=3839">&#31616;&#20307;&#20013;&#25991;</a><font color="#D0D0D0">&#8226;</font><a class="header_nav" href="http://japan.maxim-ic.com/appnotes.cfm?an_pk=3839">&#26085;&#26412;&#35486;</a><font color="#D0D0D0">&#8226;</font><a class="header_nav" href="http://korea.maxim-ic.com/appnotes.cfm?an_pk=3839">&#54620;&#44397;&#50612;</a>&nbsp;</nobr>    </td></tr><tr valign="top">    <td colspan=3>	<img width="100%" height="1" src="http://www.maxim-ic.com.cn/maxkit/dots/white_dot.gif"><br>    </td></tr></table><!-- END: META CONTROL --><!-- BEGIN: SITE CONTROL --><table class="nav_bg" border="0" cellpadding="0" cellspacing="0" width="100%"><tr valign="top" bgcolor="#FFFFFF">    <td valign="top">    <!-- OPENING SPACER -->    <img width="1" height="12" src="http://www.maxim-ic.com.cn/maxkit/dots/clear_dot.gif"><br>    <!-- SITE CONTROL GUTS -->    <table border="0" cellpadding="0" cellspacing="0" width="100%">    <tr valign="top">	<!-- LOGO CELL -->	<td>&nbsp;<a href="http://www.maxim-ic.com.cn/"><img border="0" width="276" height="27" src="http://www.maxim-ic.com.cn/maxkit/images/max_logo_header_25yrs.gif"></a></td>	<!-- SPACER CELL -->	<td><a name="top"></a>&nbsp;&nbsp;&nbsp;</td>	<!-- SEARCH FORMS CELL -->	<td align="right">	    <table border="0" cellpadding="1" cellspacing="0">	    <tr>		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>		<!-- SITE SEARCH FORM -->		<form name="power_search" method="get" action="http://www.maxim-ic.com.cn/pst/run.mvp">		<input type="hidden" name="lang" value="cn">		<td><input class="page_header" type="text" name="query" size="22" maxlength="255" value=""></td>		<td>&nbsp;</td>		<td><input type="image" src="/maxkit/images/home/cn/search_site_btn.gif" value="submit" border="0" name="image" width="44" height="17"></td>		</form>		<td>&nbsp;&nbsp;</td>		<!-- PART SEARCH FORM -->		<form name="part_search" method="post" action="http://www.maxim-ic.com.cn/quick_view2.cfm?go=part_number_search">		<td><input class="page_header" type="text" size="8" name="part_number"></td>		<td>&nbsp;</td>		<td><input type="image" src="/maxkit/images/home/cn/search_part_btn.gif" value="submit" border="0" name="image" width="44" height="17"></td>		</form>		<td>&nbsp;&nbsp;</td>	    </tr>	    </table>	</td>	<td>&nbsp;<!-- LOGIN_STATUS --></td>    </tr>    </table>    <!-- CLOSING SPACER -->    <img width="1" height="8" src="http://www.maxim-ic.com.cn/maxkit/dots/clear_dot.gif"><br>    </td></tr></table><!-- END: SITE CONTROL --><!-- BEGIN: MAIN NAVBAR --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr valign="top">    <td class="nav_bg">    <table border="0" cellpadding="0" cellspacing="1" width="100%">    <tr align="center">	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/whatsnew/">&#26368;&#26032;&#20869;&#23481;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/products.cfm">&#20135;&#21697;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/solutions/">&#26041;&#26696;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/design/">&#35774;&#35745;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/appnotes10.cfm/filter/category">&#24212;&#29992;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="https://support.maxim-ic.com/cn/">&#25216;&#26415;&#25903;&#25345;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/sales/">&#38144;&#21806;&#32852;&#32476;</a></nobr></td>	<td class="header_nav_cell" width="11%"><nobr><a class="header_nav" href="http://www.maxim-ic.com.cn/company/">&#20844;&#21496;&#31616;&#20171;</a></nobr></td>	    </tr>    </table>    </td></tr></table><!-- END: MAIN NAVBAR --><!-- BEGIN: TENT POLE --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr class=nav_bg valign="top">    <td><img width="670" height="3" src="http://www.maxim-ic.com.cn/maxkit/dots/clear_dot.gif"></td></tr></table><!-- END: TENT POLE --><!-- ================================================================== --><!-- END: SITE HEADER --><!-- ================================================================== --><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="top"><td class="nav_bg"><img src="http://www.maxim-ic.com.cn/images/clear.gif" width="32" height="300"></td><td><img src="http://www.maxim-ic.com.cn/images/clear.gif" width="16" height="1"></td><td width="99%"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><img src="http://www.maxim-ic.com.cn/images/clear.gif" width="1" height="6"></td></tr>			<tr><td><!-- BEGIN: INFO HEADER --><table border=0 cellpadding=2 cellspacing=0 width="100%"><tr valign="top" bgcolor=#f0f0f0><td class="breadcrumbs" rowspan=2><table border=0 cellpadding=1 cellspacing=0><tr><td class="breadcrumbs">
<a href="/">Maxim</a> >
<a href="/design">设计资料库</a> >
<a href="/appnotes10.cfm">应用笔记</a>

>	<a href="/appnotes10.cfm/ac_pk/2">A/D和D/A转换器/采样电路</a>	<a href="/appnotes10.cfm/ac_pk/9">数字电位器</a>	<a href="/appnotes10.cfm/ac_pk/34">电压基准</a>	<a href="/appnotes10.cfm/ac_pk/41">通用技术专题</a></td></tr><tr><td class="breadcrumbs">	关键词: <font color="#666666">DS3900,  LabView,  I2C,  串口</font></td></tr>	<tr><td class="breadcrumbs">	<a href="#rp">相关型号</a>	</td></tr></table></td><td class="breadcrumbs" align="right" nowrap>&nbsp;&nbsp;		APP 3839: Nov 09, 2006		</td></tr><tr bgcolor=#f0f0f0><td class="breadcrumbs" align="right" valign=bottom nowrap>	<a href="http://www.maxim-ic.com.cn/pdfserv/en/an/AN3839.pdf">	<img align=absMiddle border=0 src="http://www.maxim-ic.com.cn/images/acrobat-icon.gif" ALT="下载,PDF格式">下载,PDF格式</a> (154kB)<br>	<script type="text/javascript">  var new_window;  function bookmarkPage(url)  {  new_window=window.open(url,'','height=550,width=600,left=400,top=100,scrollbars=1,resizable=1');  if (window.focus) {new_window.focus()}  }</script> <table border=0 cellpadding=0 cellspacing=0><tr><td><a href="javascript:bookmarkPage('/bookmark/index.cfm?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+' ');"><img src="http://www.maxim-ic.com.cn/bookmark/images/bookmark.gif" border="0" hspace=2 vspace=6></a>&nbsp;</td><td><a href="javascript:bookmarkPage('/bookmark/help.cfm');">[?]</a></td></tr></table></td></tr></table><!-- END: INFO HEADER --></td></tr><tr><td><img src="http://www.maxim-ic.com.cn/images/clear.gif" width="1" height="10"></td></tr><tr><td>	<img src="#mediaserver#/images/clear.gif" width="1" height="10"><br clear=all><table cellpadding=0 cellspacing=0><tr><td style="color:#a5a5a5;font-weight:bold;">应用笔记3839</td></tr><tr><td><h1>运用LabView控制DS3900串口通信模块</h1></td></tr></table><p><table border="0" cellpadding="0" cellspacing="0"><tr><td>								<i>摘要:本篇应用笔记讨论了DS3900串口通信模块和LabView的使用问题,LabView是适用于嵌入式应用的图形化界面开发平台。本文可作为面向DS3900的LabView界面用户指南。</i>	<br><br clear=all>			<h2>介绍</h2>
LabView作为嵌入式应用的图形化界面开发平台得到了广泛应用。<a href=/ds3900>DS3900</a>串口通信模块是一款通用接口板,借助该接口板,用户可使用PC串口与具有I<sup>2</sup>C接口的器件通信。DS3900的指令集允许应用软件与I<sup>2</sup>C器件直接通信。<p>

本应用笔记是面向DS3900的LabView界面的用户指南。首先,用户需要安装LabView。为用户提供了标准VI,以加载并运行程序。可以<a href=ftp://ftp.dalsemi.com/pub/system_extension/AppNotes/AN3839/DS3900LV.zip>下载</a>与本应用笔记相关的LabView代码(ZIP,321K)。<p>

<h2>使用LabView软件</h2>
加载VI后,用户必须运行该程序并按照以下步骤操作。(见<b>图1</b>)<p> 

<img src=http://www.maxim-ic.com.cn/images/appnotes/3839/3839Fig01.jpg alt="Figure 1. LabView screen from which the user configures a system for operation."><br>
<i>图1. LabView界面,用户通过该界面配置系统,以准备工作</i><p>

<ol>
<li>用户首先要选择DS3900所连接的串口。LabView自动搜索所有的可用串口资源,并在下拉列表中显示这些串口。选择DS3900所连接的串口。<p> 
<b>注意:</b>与DS3900通信的缺省波特率为57600。本应用已在该波特率下进行了测试,可正常工作。建议用户在使用本应用时不要改变这个波特率。

<li>正确设置串口后,即可正常使用LED开/关功能。如果终端应用将LED连接到DS3900的脉冲输出端口(P3引脚),则按下LED开/关按钮时LED会闪烁。

<li>下一步,通过点击<b>FIND I2C ADDRESS</b>按钮,找到连接到I<sup>2</sup>C总线上的所有器件地址。在<b>Set I2C Address</b>输入框内键入将要与VI通信的从器件地址。

<li>通过窗口顶端的标签选择用户要使用的功能。提供多种功能选项:
<ol>
<li>1BYTE:读或写一个寄存器,每次1个字节。
<li>2BYTE:读或写两个连续存储器地址。我们假定以下情况:在每次读或写操作完成后,设备的内部地址计数器自动递增。
<li>Manual (手动):用户通过它可以控制I<sup>2</sup>C总线如何操作。下面的<b>手动控制</b>一节给出了一些例子。
</ol>
</ol><p>

<h2>单字节读/写操作</h2>

<img src=http://www.maxim-ic.com.cn/images/appnotes/3839/3839Fig02.jpg alt="Figure 2. When performing a single-byte operation, the user selects among four addresses for communicating with the I2C device."><br> 
<i>图2. 进行单字节读/写操作时,用户可选择四个地址以便和I<sup>2</sup>C器件进行通信。</i><p>

用户可以选择四个不同地址以进行通信(<b>图2</b>)。任何<b>READ DATA</b>结果都会被复制到相应的<b>WRITE DATA</b>输入框内,以便于处理各数据位。<p>

<b>双字节读/写操作</b><p>

<img src=http://www.maxim-ic.com.cn/images/appnotes/3839/3839Fig03.jpg alt="Figure 3. The 2BYTE tab lets the user read data from two registers."><br> 
<i>图3. 2BYTE标签允许用户读取两个寄存器的数据。</i><p>

对于某些特定设备,一个寄存器可能包括存储器中的两个连续字节。如果设备的存储器地址指针可自动递增以指向下一个寄存器,则<b>2BYTE</b>标签(<b>图3</b>)允许用户读取两个连续寄存器。读出的数据会被自动复制到<b>WRITE DATA TO</b>输入框内。<p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -