1-Wire软件资源指南和驱动程序说明
性能优异的1-Wire网络驱动器

性能优异的1-Wire网络驱动器摘要:本文介绍了一种基于微控制器的1-Wire®主机接口,适用于小规模、中等规模以及大规模的1-Wire网络。
采用精细的阻抗匹配和"智能" (软件控制)强上拉、摆率控制等方法保证网络的可靠工作。
本文给出了软件流程图,有助于用户利用任何适当的微控制器产生正确的复位脉冲、在线检测、写“1”、写“0”以及读时隙的1-Wire时序。
示波器测试曲线说明了驱动器的时间特性以及远距离通信时传输线的影响。
简介1-Wire网络的可靠性在很大程度上取决于主机与1-Wire从机器件之间所采用的通信驱动电路的性能。
本文介绍了一种1-Wire主机端接口,采用精细的阻抗匹配和"智能" (软件控制)强上拉等方法,保证网络在轻载到重载范围内均能可靠工作,且通信距离可达500m。
关于创建可靠的1-Wire网络指南,请参见应用笔记148。
电路描述网络驱动器(图1)由下拉部分(Q1,R1,C1,R5)和上拉部分(Q2,R2,C2,R6)组成。
晶体管Q3与周围的元件(C4、R7)组成强上拉电路,可为诸如EEPROM、温度传感器等器件提供额外电源。
本文没有讨论"强上拉"的功能。
任何时候,三个晶体管中最多只有一个处于导通状态;当1-Wire不进行通信("空闲"状态)时,这三个晶体管都不导通。
图1. 驱动器原理图R4、R1和R3的串联电路提供标准的1-Wire到V CC上拉。
在这种电路情况下,总的上拉电阻近似为1kΩ。
当1-Wire线空闲时,则线上呈现此阻抗。
由于R4与Q1的漏极相连,因此Q1导通时电流会流过该电阻,但不会影响1-Wire总线的低电平电压。
1-Wire总线电压升至5V的速度是由R4+R1+R3的电阻值和1-Wire网络的负载决定的。
不建议减小R4阻值,否则会导致1-Wire总线的低电平电压升高,而这不是我们所期望的。
BASCOM-AVR 单总线(1-Wire)接口和温度计 说明书

单总线它实现了在一条数据线上进行双向数据传输使系统布线更方便图8.6.2 程序8515def.dat定义度定义汉字的显示字符 Deflcdchar 2 , 31 , 4 , 31 , 4 , 12 , 10 , 18 , 17 天Portc.0接DS1820的数据线 Config Lcdpin=Pin,Db4=Porta.4,Db5=Porta.5,Db6=Porta.6,Db7=Porta.7,E=Porta.0,Rs=Porta.1 Config Lcd = 16 * 2 清LCD显示第一行显示提示字符串 Locate 2 , 1 : Lcd Chr(1) ; Chr(2) 2列显示汉字 Locate 2 , 8 : Lcd Chr(0) ; "C" Do 1wwrite &HCC : 1wwrite &H44 启动温度转换 Waitms 255 Waitms 255 DS1820初始化 1wwrite &HCC 跳过ROM操作 1wwrite &HBE 读温度值 Data1(1) = 1wread(9) 共9个字节 1wreset 无DS1820显示 Else Crc = 0 For I = 1 To 9 CRC校验正确CRC校验正确负温度显示号 Else Locate 2 , 3 : Lcd " " 以下显示温度CRC校验错***.*CRC计算用的表格 Data 0 , 94 , 188 , 226 , 97 , 63 , 221 , 131 , 194 , 156 Data 126 , 32 , 163 , 253 , 31 , 65 , 157 , 195 , 33 , 127 Data 252 , 162 , 64 , 30 , 95 , 1 , 227 , 189 , 62 , 96 Data 130 , 220 , 35 , 125 , 159 , 193 , 66 , 28 , 254 , 160 是各种总线中使用信号线较少多主机时钟同步和仲裁等功能很强的总线许多接口芯片如LCD驱动A/D,D/A都采用I2C接口而且大多数的IC卡的接口都采用I2C总线用AVR系统构成简易IC卡读写器I2C串行总线使用两根信号线另一根是时钟线SCL各设备的时钟线SCL接到总线的SCL关于I2C的详细内容请参考有关的书籍和资料因此需要用两根 I/O线来模拟实现I2C总线的功能实现I2C总线启始读BASCOM-AVR提供了专用的 I2C语句实验中采用的IC卡为ATMEL公司的AT24C01A/2/4/8/16该类IC卡上的芯片就是采用I2C总线接口的串行CMOS EEPROMAVR系列的单片微控制器内部还提供了一定容量的EEPROM设定值或密码口令字等它不仅可使系统设计节省硬件(EEPROM芯片)和连线提高了系统的可靠性和保密性使用了AVR片内的EEPROM来保存密码判别IC卡的非法性写用户使用PC的键盘输入8位自定密码将密码写入用户的IC卡中(也可同时写入AVR的EEPROM中作为系统密码)并同系统密码核对IC卡读写器采用LCD液晶显示器 原理图Exp9.bas ¥regfile = "8515def.dat" ¥crystal = 4000000 ¥baud = 9600 Dim I As Byte , Temp As Byte 定义LCD显示屏接口 Config Scl = Portd.7 定义Portd.6为I2C总线的Dda Const Adresw = &HA0 定义IC卡的读地址指令字 Config Pinc.0 = Input , Pinc.1 = Input , Pinc.2 = Input Portc.0 = 1 : Portc.1 = 1 : Portc.2 = 1 清LCD显示 Do Cls Locate 1 , 1 : Lcd "Demo for IC_Card" 检测有无IC卡插入 Locate 2 , 1 : Lcd "No IC_Card " 有IC卡插入 If Pinc.0 = 0 Then Cls Locate 1 , 1 : Lcd "Enter Password: " 要求输入密码字 I = 1 Locate 2 , 1 Do Temp = Inkey() 的密码字符长度为8个 Lcd Chr(temp) 将8个密码字写入IC卡中 I2cstart 如果系统设置为修改系统密码时 Writeeeprom Data1(i) , I 写入地址为1-8 End If For I = 1 To 8 判别写入密码同用户输入的密码 If Data1(i) <> Data2(i) Then 相同不同等待用户抽出IC卡 Else 读IC卡上的密码字8个 Lcd Chr(data1(i)) 读系统密码字8个 Next Card_ok = 0 For I = 1 To 8 比较 Card_ok = 1 Exit For End If Next Locate 2 , 1 If Card_ok = 1 Then Lcd "Password not ok!" 密码相符 End If Do Loop Until Pinc.2 = 1 返回循环 End 。
1-Wire_ Software Resource Guide Device Description

Maxim > App Notes > 1-Wire® DEVICES MICROCONTROLLERSJul 08, 2008 Keywords: 1-Wire, OneWire, iButton, API, application program interface, software, examples, TMEX, java, OWAPI, publicdomain, PD, windows COM, OWCOM, , .NET, dotnetAPPLICATION NOTE 1551-Wire® Software Resource Guide Device DescriptionAbstract: There are over 30 different 1-Wire devices, including iButton® devices, that Maxim currently produces. Navigating the available APIs, software examples, and other resources to communicate with this array of devices or finding the correct resource for a single device type can be a daunting task. This document provides an overview of the available resources and a selection guide. The current 1-Wire devices are also presented in a convenient table, providing device descriptions and family code lookup.Available APIs include TMEX (an API for Microsoft Windows®), 1-Wire Public Domain Kit (a cross-platform API), the 1-Wire API for Java™ (OWAPI) and its variant 1-Wire API for .NET (), and 1-Wire API for .NET Compact (. Compact). All of the APIs described in this document are free to use without restriction and, in most cases, include the complete source code.IntroductionThere are over 30 different 1-Wire devices, including iButton devices, that Maxim currently produces. Navigating the available application program interfaces (APIs), software examples, and other resources to communicate with this array of devices, or finding the correct resource for a single device type, can be a daunting task. This guide provides an overview of available resources and a selection guide. The APIs described in this document are free to use without restriction and, in most cases, include the complete source code.1-Wire OverviewThe 1-Wire bus is a simple signaling scheme that performs two-way communications between a single master and peripheral devices over a single connection. A powerful feature that all 1-Wire bus devices share is that each and every device, in a chip or an iButton, has a factory-programmed registration number that will never be repeated in any other device. In effect, every device is unique. This allows any single device to be individually selected from among the many that can be connected to the same bus wire. Because one, two, or even dozens of 1-Wire devices can share a single wire for communications, a binary searching algorithm is used to find each device in turn. Once each device registration number is known, any device can be uniquely selected for communication using that registration number to address it.The first part of any communication involves the bus master issuing a reset, which synchronizes the entire bus. A slave device is then selected for subsequent communications. This can be done by selecting all slaves, selecting a specific slave (using the registration number of the device), or by discovering the next slave on the bus using a binary search algorithm. These commands are referred to collectively as network function or read-only-memory (ROM) commands. Once a specific device has been selected, all other devices drop out and ignore subsequent communications until the next reset is issued.Once a device is isolated for bus communication, the master can issue device-specific commands to it, send data to it, or read data from it. Because each device type performs different functions and serves a different purpose, each type has a unique protocol once it has been selected. Even though each device type may have different protocols and features, they all have the same selection process and follow the command flow seen in Figure 1.Figure 1. Typical 1-Wire communication flow.An integral part of the unique registration number in each slave is an 8-bit family code. This code is specific to the device model. Because each device model performs different functions, this code is used to select the protocol that will be used to control or interrogate it. See Table 1 for a mapping of family codes for Maxim 1-Wire parts.Information Business Unit's (BU's) software libraries.¹These devices are no longer recommended for new designs.API FundamentalsThe different APIs for communicating with 1-Wire devices have common features that reflect the fundamental communication issues arising from the protocol. Figure 2 outlines the common groupings of the functions for the different APIs. Sincemost 1-Wire devices have memory, the memory I/O functions are treated as a common API group although the functions donot apply to all devices. All other nonmemory specialty functions are lumped into the device-specific device grouping.The typical sequence to use these functions is outlined in Figure 3. The SESSION functions wrap around the communication calls to the device, which typically involve using a NETWORK function followed by a memory or DEVICE-specific operation.Figure 3. API usage flow.The nature of iButton communication is inherently 'touch.' This means that contact with the device is not always reliable. The iButton might be inserted into the reader and have intermittent contact during the read. Consequently a consistent methodology of error recovery must be rigorously followed. This usually entails doing retries when a spurious error is detected and utilizing CRC checks in data communication. The file I/O functions in the APIs use a standard file structure detailed inthe 1-Wire File Structure section of application note 114, "1-Wire File Structure." This structure uses a CRC16 on every page of data to quickly verify the validity of the data being read. Most of the 1-Wire API functions have little or no automatic retries. The retries are under application control. See the application note 159, "Ultra-Reliable 1-Wire Communications," for methodology of error recovery and risk assessment in doing 1-Wire communication.API SelectionThere are principally five different APIs that are considered in this document. The APIs operate on different platforms, use different languages, and have different capabilities. Table 2 displays these five APIs with a brief description, and Table 3 maps the operating system with the available APIs divided by language.Table 2. API Descriptions1-Wire Public Domain PD A completely open-source public domain API written in C and designed to be portable across multiple PC operating systems, handheld operating systems, and microcontroller platforms. For PC platforms, it supports all 1-Wire adapters (masters) through native driver libraries on Microsoft Windows and specific 1-Wire adapters (DS9097U serial and DS9490 USB adapters) on other PC operating systems using cross-platform libraries.1-Wire API for Java OWAPI Completely open-source, high-level Java API that supports almost ALL 1-Wire devices. In addition to native 1-Wire master support, it also supports theDS9097U serial adapter and DS9490 USB adapter through cross-platform libraries.1-Wire API for .NET OWAPI code base compiled with J# for the Microsoft .NET Framework.1-Wire API for .NET Compact pact Compact .NET Framework for Windows CE machines or platforms that do not have the Microsoft Visual J#® Redistributable Package. It currently consists of just the low-level 1-Wire link and Network layer ported to C#.TMEX API TMEX Supports all 1-Wire master adapters on Windows platforms (32 and 64 bit). Provides link and file I/O functions, but no device functions. Drivers are closed source. This API is called by other APIs to obtain access to all ofthe 1-Wire adapter types.Table 3. API Operating System and Language CoverageWindows Vista®TMEX //pact PD OWAPI Windows Vista x64TMEX //pact PD OWAPI*TINI® is an embedded platform with a Java-based OS made by Maxim.¹No longer supported. Legacy driver downloads still available from the Maxim web site.The support of the individual device families also varies from API to API. Table 4 lists all of the currently available 1-Wire devices with flags indicating the available support in each API. The key for the Table 4 flags is located at the bottom. Note that the device cells without shading are considered fully supported by the API. A light-shaded cell indicates partial support, and dark-shaded cell indicates minimal support.owAttribute - Changes the attributes of a file.owChangeDirectory - Changes the current directory.owCloseFile - Closes a file.owCreateDir - Creates a directory.owCreateFile - Creates a file for writing.owCreateProgramJob - Creates a write buffer for logging EPROM programming pending jobs.owDeleteFile - Deletes a file.owDoProgramJob - Write the pending EPROM programming jobs.owFirstFile - Finds the first file in the current directory.owFormat - Formats the 1-Wire File Structure file system.owGetCurrentDir - Gets the current directory.owNextFile - Finds the next file in the current directory.owOpenFile - Opens a file for reading.owReadFile - Reads an opened file.owReadFile - Reads data from a file.owRemoveDir - Removes a directory.owReNameFile - Changes the name of a file.owWriteFile - Writes to a file that has been created.DoAtoDConversion - Does an A/D conversion on DS2450.ReadSwitch12 - Reads the state of the DS2406 switch.readCounter - Reads the counter value associated with a specific memory page on a DS2423 1-Wire chip....(too numerous to list all device-specific functions)Figure 4. PD API functions.Example 1 shows a PD code fragment that follows the API usage flow outlined in Figure 3. For simplicity, each device on the 1-Wire network is discovered during each pass through the work loop. A more sophisticated application could potentially find just one device type or perhaps select a device found in a previous search.int rslt, portnum=0, doing_work=1;char portString[50]; // set to platform appropriate port string// work loopwhile (doing_work){// acquire the 1-Wire Net (SESSION)if (owAcquire(portnum, portString)){// find all devices (NETWORK)rslt = owFirst(portnum, TRUE, FALSE);while (rslt){// do SOMETHING with device found (TRANSPORT/FILE/DEVICE)// . . .// find the next device (NETWORK)rslt = owNext(portnum, TRUE, FALSE);}// release the 1-Wire Net (SESSION)owRelease(portnum);}else{// Could not acquire 1-Wire network// . . .}// do other application work// . . .}Example 1. PD CODE example.Figures 5a and 5b list the C-language modules that make up each of the two sets of 1-Wire PD libraries. Also displayed are the 'TODO' functions that must be provided to port the library to a new platform. Several example platform link files that implement the 'TODO' functions are provided in the kit.owsesu.cowllu.c ds2480ut.c ds2480.hownetu.c crcutil.c (required to compile)mbappreg.c mbappreg.h mbee.c mbee.h mbee77.c mbee77.hmbeewp.c mbeewp.h mbeprom.c mbeprom.h mbnv.c mbnv.hmbnvcrc.c mbnvcrc.h mbscr.c mbscr.h mbscrcrc.c mbscrcrc.hmbscree.c mbscree.h mbscrex.c mbscrex.h mbscrx77.c mbscrx77.hmbsha.c mbsha.h mbshaee.c mbshaee.h owtrnu.c pw77.cpw77.h rawmem.c rawmem.howcache.c owfile.c owfile.h owpgrw.c owprgm.cad26.c ad26.h atod20.c atod26.c atod26.h cnt1d.chumutil.c humutil.h jib96.c jib96.h jib96o.c ps02.cps02.h sha18.c sha33.c shadbtvm.c shadebit.c shaib.cshaib.h swt05.c swt12.c swt12.h swt1c.c swt1c.hswt1f.c swt29.c swt29.h swt3a.c swt3a.h temp10.cthermo21.c hermo21.h time04.c time04.h weather.c weather.hioutil.c owerr.c findtype.c ownet.h screenio.c sprintf.ccrcutil.cProvided a SERIAL interface module that implements the following functions:BreakCOM* - Sends a 'BREAK' on the serial port for at least 2ms.CloseCOM - Closes the previously opened serial port. (optional for some platforms)FlushCOM* - Allows any pending write operations to complete and clear input buffer.msDelay* - Delays at least the specified number of milliseconds.msGettick - Returns an increment millisecond counter. (optional for some examples)OpenCOM - Opens the specified serial port for communication. (optional for some platforms)ReadCOM* - Reads a specified number of bytes from the serial port.SetCOMBaud - Changes the serial BAUD rate to the rate specified. (optional if needs overdrive)WriteCOM* - Writes a specified number of bytes to the serial port.* Minimum functions required for basic operation.Figure 5a. PD 'USERIAL' implementation.(see TODO)(see TODO)ownet.c crcutil.c (required to compile)Same as USERIAL implementation except 'owtrnu.c' is replaced by 'owtran.c'.Same as USERIAL implementation.Same as USERIAL implementation.Same as USERIAL implementation.Provided a LINK and SESSION interface module that implements the following functions:owAcquire - Acquires the 1-Wire net.owRelease - Releases the previously acquired 1-Wire net.owHasOverDrive - Indicates whether the adapter has overdrive capability.owHasPowerDelivery - Indicates whether the adapter can deliver power.owHasProgramPulse - Indicates whether or not EPROM programming voltage is available.owLevel - Sets the 1-Wire net line level to Normal (5V weak pullup), Power Delivery (5V strong pullup), or Program Level (12V EPROM programming level).owProgramPulse - Sends timed programming pulse for EPROM 1-Wire device writing.owReadBitPower - Reads 1 bit and then optionally supplies power.owReadByte - Receives 8 bits from the 1-Wire net by sending all 1's (0xFF).owSpeed - Sets the speed of the 1-Wire net to Normal (16kb) or Overdrive (142kb).owTouchBit* - Sends and receives 1 bit from the 1-Wire net.owTouchByte - Sends and receives 8 bits from the 1-Wire net.owTouchReset* - Resets all devices on the 1-Wire net and return result.owWriteByte - Sends 8 bits to the 1-Wire net and verifies the echo received matches.owWriteBytePower - Sends 8 bits of communication to the 1-Wire net and then supplies power.* Minimum functions required for basic operation.Figure 5b. PD 'GENERAL' implementation.InstallationThe 1-Wire PD API is a set of C modules, so there is no formal installation. As provided in the example builds, the required modules are compiled directly into the applications. This does not preclude developers from combining the modules into a loadable library such as a Windows DLL.Keep in mind that some builds require native 1-Wire adapter drivers or equivalent. As most OS platforms have built-in serial port drivers, the userial builds of the 1-Wire PD API do not need any other driver. However, for USB and parallel port 1-Wire adapter support, native or cross-platform drivers will need to be installed. References to the appropriate driver downloads are available in the documentation of the actual 1-Wire PD Kit builds available online.1-Wire API for Java (OWAPI) OverviewThe 1-Wire API for Java was designed from the ground up to be a very robust, highly object-oriented foundation forbuilding 1-Wire applications in Java. It extends the ability of programmers to develop portable, cross-platform software and shortens the time to market for their 1-Wire integrated products.The API consists of many Java classes and interfaces. One special group of Java classes in the 1-Wire API is the container (class OneWireContainer). Support for particular 1-Wire devices, including iButtons, is provided through containers. The API has over 30 different container types, representing most 1-Wire devices. Each container encapsulates and implements the functionality of an individual device.A container interacts with a 1-Wire device through a 1-Wire adapter class that represents a physical 1-Wire adapter (class DSPortAdapter). The instance of the adapter is produced from the provider class (class OneWireAccessProvider). The actualimplementations of the 1-Wire adapters vary from platform to platform, but they all have the same interface. Some platforms use native drivers, but most at least support the DS9097U-XXX serial adapters using RXTX (a cross-platform serial COM port API). This API is available from RXTX's web site.The 1-Wire API for Java Software Development Kit is available on the iButton web site. Like the 1-Wire PD Kit, the complete Java source to OWAPI is provided under a public-domain-style license.Figure 6 shows the typical object creation sequence for this API. The 'provider' creates an instance (or enumeration) of an'adapter,' which in turn can create instances of device 'containers.' Communication to the device is then performed almost exclusively through the container.Figure 6. OWAPI object creation.Figure 7 shows the common features of a container. A device that contains memory will create a memory bank instance for each memory bank. The memory is divided up into banks depending on the feature set of the bank. For example, one bank could be volatile while another is nonvolatile. Or, a bank could be general-purpose memory or it could be memory-mapped to change the functionality of the device.Figure 7. OWAPI ONEWIRECONTAINER features.Figure 8 shows the methods provided by the base OWAPI classes. The class or package is displayed in bold. Note that, because each container has high level methods to manipulate each device type, the LINK level methods in the adapter are not usually called directly.com.dalsemi.onewire.adapter.DSPortAdapterbeginExclusive - Acquires exclusive use of the 1-Wire net.endExclusive - Releases the exclusive lock on the 1-Wire net.com.dalsemi.onewire.adapter.DSPortAdaptercanBreak - Checks if a 1-Wire 'break' (long low) operation is supported by the adapter.canDeliverPower - Checks if 'strong-pullup' power delivery is supported by the adapter.canDeliverSmartPower - Checks if 'smart' power delivery is supported by the adapter. 'Smart' power delivery is the ability to sense when power consumption has reduced and automatically stop the power delivery.canFlex - Checks if flexible long-line communication timing is supported by the adapter.canHyperdrive - Checks if hyperdrive communication speed is supported by the adapter.canOverdrive - Checks if overdrive communication speed is supported by the adapter.canProgram - Checks if 12V EPROM programming voltage is supported by the adapter.dataBlock - Sends and receives a block of data to the 1-Wire net.getBit - Reads a single bit from the 1-Wire net.getBlock - Reads a block from the 1-Wire net by sending all (0xFF)s.getByte - Reads a byte from the 1-Wire net by sending all 1's (0xFF).getSpeed - Reads the current 1-Wire communication speed.putBit - Writes a bit to the 1-Wire net.putByte - Writes a byte to the 1-Wire net and verifies the echo is correct.reset - Resets all of the 1-Wire net devices.setPowerDuration - Sets the power delivery duration.setPowerNormal - Turns off the power delivery.setProgramPulseDuration - Sets the program pulse duration.setSpeed - Sets the 1-Wire communication speed.startBreak - Starts a break (low) on the 1-Wire net.startPowerDelivery - Starts the power delivery.startProgramPulse - Starts the program pulse.com.dalsemi.onewire.adapter.DSPortAdapterexcludeFamily - Excludes a family group from the search.findFirstDevice - Finds the first device on the 1-Wire net without auto container creation.findNextDevice - Finds the next device on the 1-Wire net without auto container creation.getAllDeviceContainers - Searches and finds all devices on the 1-Wire net with containers.getDeviceContainer - Gets a device container for the 'current' device found.getFirstDeviceContainer - Finds the first device and create a container for it.getNextDeviceContainer - Finds the next device and create a container for it.setNoResetSearch - Sets the 1-Wire net search to not issue a 1-Wire reset.setSearchAllDevices - Sets the 1-Wire net search to include all devices (remove alarm-only). setSearchOnlyAlarmingDevices - Sets the 1-Wire net search to only include alarming devices.targetAllFamilies - Sets the 1-Wire net search to include all devices (remove exclusions).targetFamily - Targets a particular family group in the 1-Wire net search.(also in com.dalsemi.onewire.container.*)isAlarming - Checks to see if the device is in an alarm state.isPresent - Checks to see if the device is present on the 1-Wire net.select - Selects the 1-Wire net device to ready it for a device-specific operation command.com.dalsemi.onewire.container.MemoryBankgetBankDescription - Returns a text description of the memory bank.getSize - Gets the size of the memory bank in bytes.getStartPhysicalAddress - Gets the starting physical address of the memory bank.isGeneralPurposeMemory - Checks if the memory bank is general purpose (not memory mapped).isNonVolatile - Checks if the memory bank is nonvolatile.isReadOnly - Checks if the memory bank is read-only.isReadWrite - Checks if the memory bank is read and write capable.isWriteOnce - Checks if the memory bank is write once, such as EPROM.needsPowerDelivery - Checks if this memory bank requires power delivery to write.needsProgramPulse - Checks if this memory bank requires program pulse to write.read - Reads the memory bank without interpretation (no packet structure).setWriteVerification - Sets the API to do an extra verification after writes.write - Writes the memory bank raw (no packet structure).com.dalsemi.onewire.container.PagedMemoryBankgetExtraInfoDescription - Gets a description of extra information associated with this bank.getExtraInfoLength - Gets the length in bytes of the extra information in each page.Example 2 shows a OWAPI code fragment that follows the API usage flow outlined in Figure 3. Like the PD code example in Example 1, each device on the 1-Wire network is discovered during each pass through the work loop, while a moresophisticated application could find just one device type or a previously found device.languages, such as C#, J#, and . For 1-Wire .NET examples, please refer to the appropriate software development kitWindows Platforms Supported by TMEXThe following Microsoft Windows platforms are supported by TMEX: Windows 2008, Windows 2003, Windows Vista, and Windows XP SP2. This includes both x86 (32-bit) and x64 (64-bit) operating system versions. Please note that if drivers for earlier Windows operating system versions are required, legacy versions of TMEX are available, though not actively supported, from Maxim's web site. Please download version 4.00 or below of the 1-Wire Drivers (which install the TMEX API libraries). 1-Wire Drivers installation packages can be found here: iButton: 1-Wire Drivers for Windows.Figure 9. TMEX API drivers and other API connectivity.Figure 10 lists functions provided by the TMEX API. Note that this API does not provide any nonmemory-device-specific functions.More information on the 1-Wire Drivers and OneWireViewer demo can be found on the iButton web site under "Software Resources."Other ToolsWhile the APIs discussed in this document represent a large part of the available resources for communication with 1-Wire devices, it is by no means the only resource. This section outlines some other available resources.Software Authorization APISoftware authorization is simply the locking of a software application to require the presence of a hardware token. The token in this case is an iButton connected to the user's workstation. The application polls for the presence and validity of the iButton before running. It can also continuously query while the application executes. In practice, any of the APIs outlined in this document can be used for this type of application; however, there are specific concerns that must be considered. External drivers present a weakness to the security by allowing a user to replace the driver and thereby defeat the lock. The software authorization API, built upon the 1-Wire PD Kit, has been developed specifically for this type of application and includes linkable modules instead of external drivers.The design of the Software Authorization API is centered on the simplest use cases possible, to make integration into the software programmer's existing code easy. There are three main services provided by the API:q Initializing a 1-Wire deviceq Authenticating the deviceq Clearing a device (so it is no longer a valid part of the system)Information on the 1-Wire Software Authorization Kit can be found on the iButton web site.Software Example Search EngineMaxim continually develops 1-Wire example software applications demonstrating the APIs described in this document. Examples that do not appear in the SDKs can be found by utilizing our online Software Example Search Engine. Many of these examples (with source code) are added to the search engine first (as a separate download) before being added to its respective SDK. The search engine can search for software examples by:q1-Wire device (Thermochron, SHA iButton, etc.)q Platform (Win32, Linux, TINI, etc.)q API (TMEX, 1-Wire Public Domain, 1-Wire .NET, etc.)q Programming language (C, Java, C#, Visual Basic, Delphi, etc.)Included in the search results are a description of the program and its appropriate download link.1-Wire Software Development Interest GroupIt is recommended that 1-Wire developers join the web-based 1-Wire Software Developer's Forum. The purpose of this group is to explore, discuss, and answer questions about developing applications, tools, and uses for the 1-Wire/iButton family of products. Maxim applications engineers monitor this forum to provide answers to questions posed by the group. Announcements about updates to the APIs and kit downloads are also posted to this group.Third PartyA large volume of third-party software is available for 1-Wire devices. Some are applications produced by Maxim authorized solutions developers (ASDs) for purchase with their solution. A complete list of ASDs and a solution locator are provided on the iButton site, as well as open-source projects on public forums like .DS1990R:QuickView-- Full (PDF) Data Sheet-- Free Samples DS1991:QuickView-- Full (PDF) Data SheetDS1992:QuickView-- Full (PDF) Data Sheet-- Free Samples DS1993:QuickView-- Full (PDF) Data Sheet-- Free Samples DS1994:QuickView-- Full (PDF) Data SheetDS1995:QuickView-- Full (PDF) Data SheetDS1996:QuickView-- Full (PDF) Data SheetDS2401:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2404:QuickView-- Full (PDF) Data SheetDS2405:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2406:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2407:QuickView-- Full (PDF) Data SheetDS2408:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2409:QuickView-- Full (PDF) Data SheetDS2411:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2413:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2415:QuickView-- Full (PDF) Data SheetDS2417:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2422:QuickView-- Full (PDF) Data SheetDS2423:QuickView-- Full (PDF) Data SheetDS2430A:QuickView-- Full (PDF) Data SheetDS2431:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2432:QuickView-- Abridged Data SheetDS2433:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2450:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2502:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2505:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2506:QuickView-- Full (PDF) Data Sheet-- Free Samples DS2890:QuickView-- Full (PDF) Data SheetDS28E04-100:QuickView-- Full (PDF) Data Sheet-- Free Samples AN155, AN 155, APP155, Appnote155, Appnote 155 Copyright © by Maxim Integrated ProductsAdditional legal notices: /legal。
1-wire总线接口应用

实验日期:
成绩:
1-wire
实验目的
1、理解1-wire总线的工作时序。
2、掌握DS18B20传感器的使用方法。
3、理解不同数码之间的转换方法。
实验仪器
单片机开发板、万利仿真机、稳压电源、计算机
实验原理
1、1-wire总线
近年来,美国的DALLAS公司推出了一项特有的单总线(1-Wire Bus)技术。该技术采用单根信号线进行数据传输。既可传输时钟,又能传输数据,而且数据传输是双向的,因而这种单总线技术具有线路简单,硬件开销少,成本低廉,便于总线扩展和维护等优点。
1-wire总线的读位时序如图4-25所示。首先把总线拉成地电平约8μS,然后IO口为高电平释放总线。主机(单片机)约在开始后15μS读IO数据,再等待读时序结束(约45μS),最后释放总线,准备读下一位。位与位之间间隔没有限制,但至少1μS以上。
图4-25 1-wire总线读位时序图
总线复位时序如图4-26所示。主机先把总线拉成低电平并保持480μS-960μS,然后主机释放总线(变成高电平)约15μS-60μS,DS18B20发出存在信号(低电平60μS-240μS),然后DS18B20也释放总线,准备开始通信。
此命令读暂存存储器的内容读开始于字节0,并继续经过暂存存储器直至第九个字节字节8CRC被读出为止。主机可以在任何时候发出一复位以中止读操作。
复制暂存存储器Copy Scratchpad [48h]
此命令把暂存存储器复制入DS18B20的E2PROM存储器,把温度存储器字节存贮入非易失性存储器。如果由寄生电源供电总线主机在发出此命令之后必须能立即强制上拉至少10mS。
Skip ROM(跳过ROM)[CCh]
在单点总线系统中,此命令通过允许总线主机不提供64位ROM编码而访问存储器操作来节省时间。如果在总线上存在多于一个的从属器件,而且在SkipROM命令之后发出读命令,那么由于多个从片同时发送数据会在总线上发生数据冲突漏极开路下拉会产生线与的效果。
用软件实现1-Wire-通信

摘要:在没有专用总线主机(如DS2480B、DS2482)的情况下,微处理器可以轻松地产生1-Wire 时序信号。
本应用笔记给出了一个采用…C‟语言编写、支持标准速率的1-Wire主机通信基本子程序实例。
1-Wire总线的四个基本操作是:复位、写“1”、写“0”和读数据位。
字节操作可以通过反复调用位操作实现,本文提供了通过各种传输线与1-Wire器件进行可靠通信的时间参数。
引言在没有专用总线主机的情况下,微处理器可以轻松地产生1-Wire时序信号。
本应用笔记给出了一个采用C语言编写、支持标准速率的1-Wire主机通信基本子程序实例。
此外,本文也讨论了高速通信模式。
要使该实例中的代码正常运行,系统必须满足以下几点要求:1. 微处理器的通信端口必须是双向的,其输出为漏极开路,且线上具有弱上拉。
这也是所有1-Wire总线的基本要求。
关于简单的1-Wire主机微处理器电路实例,请参见应用笔记4206:"为嵌入式应用选择合适的1-Wire主机"中的1类部分。
2. 微处理器必须能产生标准速度1-Wire通信所需的精确1µs延时和高速通信所需要的0.25µs延时。
3. 通信过程不能被中断。
1-Wire总线有四种基本操作:复位、写1位、写0位和读位操作。
在数据资料中,将完成一位传输的时间称为一个时隙。
于是字节传输可以通过多次调用位操作来实现,下面的表1是各个操作的简要说明以及实现这些操作所必须的步骤列表。
图1为其时序波形图。
表2给出了通常线路条件下1-Wire主机与1-Wire器件通信的推荐时间。
如果与1-Wire主机相连的器件比较特殊或者线路条件比较特殊,则可以采用最值。
请参考可下载的工作表中的系统和器件参数,确定最小值和最大值。
表1. 1-Wire操作图1. 1-Wire时序图表2. 1-Wire主机时序计算这些值的工作表可供下载。
代码实例下面代码实例都依赖于两个通用的'C'函数outp和inp,从IO端口读写字节数据。
1-Wire(单线)概述

会话 分时使用总线。这对于操作系统或几个进程或线程要求同时使用总线的情况下是非 常重要的。当多项操作在同一器件上运行而又不能被打断的时候,需要独占总线的使用 权。
链路 基本的 1-Wire 总线通信功能。所有的 1-Wire 总线的通信功能可以归结为:复位 所有的器件和读写位。这也包括设置总线电特性的功能,如提供专用的 EPROM 编程脉 冲或进行供电。
选定 1-Wire 器件
执行一个特定器件操作
每个受控器件的序列号的整数部分是一个 8 位的家族代码。这个代码对器件模型来说是 特定的。因为每种器件模型执行不同的功能,所以可以用代码来选择用于控制或者查询器件 的协议。表 1 是达拉斯半导体公司的器件型号的家族代码。
家族代码对照 表 1
家族代码
器件型号()iButton 封装
(DS1921Z)22 NhomakorabeaDS1822
23
(DS1973), DS2433
24
(DS1904), DS2415
26
DS2438
27
DS2417
28
DS18B20
DS2480B 1-Wire时序的理解及配置

摘要:DS2480B是带有UART主机接口的1-Wire®主机(驱动器)。
该驱动器专门为电源传输进行优化,并支持嵌入式应用中的高速模式。
DS2480B的特性之一在于其具有伸缩速率模式,允许设计者以标准速度配置1-Wire时序。
本应用笔记阐述了如何确定最佳时序配置以及如何用Windows®软件将设置参数写入芯片。
文章还将DS2480B与上拉电阻的驱动强度进行比较,详细描述见应用笔记3829。
附录一描述了如何确定最佳的配置参数。
附录二则给出了估算DS2480B可以驱动的从器件数目的算法,这取决于主机电气特性以及网络电缆的容性负载。
附录三讨论了网络过载的条件。
引言DS2480B是带UART主机接口的1-Wire主机(驱动器)。
该器件针对电源传输进行优化并支持嵌入式应用的高速模式,可以将主机从生成严格定时的1-Wire波形这一任务中解脱出来。
DS2480 B采用有源电路,缩短了时隙结束时的恢复时间。
图1给出了1-Wire驱动器部分的简化电路图。
图1. DS2480B 1-Wire驱动器的简化电路当1-Wire总线处于空闲状态时,DS2480B驱动器通过一个受控电流源提供上拉。
该电流源可被关闭(下拉期间),可提供弱上拉电流(下拉及空闲时IWEAKPU),或者提供一个有源上拉(上升沿时IACTPU)。
下拉电路(Q1)的压摆率可以通过软件调整。
Q2表示需要大电流的1-Wire从器件功能(如EEPROM编程或温度转换)所采用的供电电路。
Q2的功能在本应用笔记中未讨论。
为支持有效的布线配置,需要一个外部线路终端电阻RT (~100Ω)以尽量减小传输线路的影响,如反射、下冲和过冲。
然而,加入RT后会导致有源上拉在1-Wire总线完全充电之前过早关闭。
这是因为DS2480B检测的是其1-Wire引脚的电压,而非1-Wire网络从器件一侧的电压。
当1-Wire引脚电压到达内部门限值(典型值IACTPU ×RT =15mA × 100Ω = 1.5V)时,从器件一侧的电压将低于1-Wire引脚电压,差值为RT上的压降。
1-Wire总线协议应用

1-Wire总线协议应用作为一种单主机多从机的总线系统,在一条1-Wire总线上可挂接的从器件数量几乎不受限制。
为了不引起逻辑上的冲突,所有从器件的1-Wire总线接口都是漏极开路的,因此在使用时必须对总线外加上拉电阻(一般取5kΩ左右)。
主机对1-Wire总线的基本操作分为复位、读和写三种,其中所有的读写操作均为低位在前高位在后。
复位、读和写是1-Wire总线通信的基础,下面通过具体程序详细介绍这3种操作的时序要求。
(程序中DQ代表1-Wire总线,定义为P1.0,uchar定义为unsigned char)1 1-Wire总线的复位复位是1-Wire总线通信中最为重要的一种操作,在每次总线通信之前主机必须首先发送复位信号。
如程序1.1所示,产生复位信号时主机首先将总线拉低480~960μs然后释放,由于上拉电阻的存在,此时总线变为高电平。
1-Wire 总线器件在接收到有效跳变的15~60μs内会将总线拉低60~240μs,在此期间主机可以通过对DQ采样来判断是否有从器件挂接在当前总线上。
函数Reset()的返回值为0表示有器件挂接在总线上,返回值为1表示没有器件挂接在总线上。
程序1.1 总线复位uchar Reset(void){uchar tdq;DQ=0; //主机拉低总线delay480μs(); //等待480μsDQ=1; //主机释放总线delay60μs(); //等待60μstdq=DQ; //主机对总线采样delay480μs(); //等待复位结束return tdq; //返回采样值}2 1-Wire总线的写操作由于只有一条I/O线,主机1-Wire总线的写操作只能逐位进行,连续写8次即可写入总线一个字节。
如程序1.2所示,当MCS-51单片机的时钟频率为12MHz时,程序中的语句_nop_();可以产生1μs的延时,调用此函数时需包含头文件“intrins.h”。
MAXIM DS2482-800 8 通道1-Wire 主控制器 说明书

注:可能对该芯片已经进行了若干完善,参数指标已经和已出版的勘误表有所出入。
通过各种销售渠道克获悉各种芯片所做的修订。
芯片勘误表请点击:/errata 。
概述DS2482-800是 I 2C*线至1-Wire ®的桥接器件,可直接与标准(100kHz 最大值)或快速(400kHz 最大值) 的I 2C 主机连接,完成I 2C 主机和任意下游1-Wire 从器件之间的双向协议转换。
相对于任何1-Wire 从器件来说, DS2482-800是一个1-Wire 主机。
经过工厂校准的内部定时器将系统主处理器从产生严格定时的1-Wire 波形中解脱出来,且同时支持标准和高速的1-Wire 通信速率。
为了优化1-Wire 波形的产生,DS2482-800在1-Wire 的上升沿和下降沿进行了摆率控制,且该器件具有一个可编程的特性,以屏蔽某些1-Wire 从器件产生的快速应答脉冲沿。
可编程的强上拉特性支持通过1-Wire 向1-Wire 从器件供电,诸如EEPROM 和传感器。
DS2482-800将这些特性整合在一起,并提供8个独立的1-Wire I/O 通道。
I 2C 从器件地址分配是由3个二进制地址输入控制的,以解决系统中其它I 2C 从器件的可能出现的地址冲突问题。
应用无线基站中心局交换机 PBX机架服务器特性I 2C 主机接口,支持100kHz 和400kHz 的I 2C 通信 速率带有可选的有源或无源1-Wire 上拉的1-Wire 主机 I/O提供复位/在线应答、8位、1位和3位1-Wire I/O 时序独立工作的8个1-Wire I/O 通道 标准和高速的1-Wire 通信速率 1-Wire 边沿控制摆率可选的1-Wire 从器件应答脉冲下降沿屏蔽,以控 制1-Wire 总线上的快速边沿为EEPROM 、温度传感器和其它具有瞬时大电流 模式的1-Wire 从器件提供低阻抗1-Wire 强上拉。
-Wire软件资源指南和驱动程序说明(PDF)

应用笔记1551-Wire软件资源指南和驱动程序说明绪论包括iButton®在内,Dallas Semiconductor目前生产的1-Wire®器件已有30多种。
如何选择已有的应用程序接口(API)、软件范例及其它资源与这一类器件进行通信,或为某个器件选择正确的资源是一件非常令人头疼的事。
本应用笔记提供了该类资源的概述和选择指南。
本文中所描述的所有API都是免费的,而且大多数情况下还包括完整的源代码。
1-Wire 概述Dallas Semiconductor 的1-Wire总线是一种简单的信号交换架构,通过一条线路在主机与外围器件之间进行双向通信。
所有的1-Wire总线都具有一个共同的特征:无论是芯片内还是iButton内,每个器件都有一个互不重复的、工厂光刻的序列号,因此,每个器件都是唯一的。
这样就允许从众多连到同一总线的器件中独立选择任何一个器件。
当1个、2个甚至多个1-Wire器件能共用一条线路进行通信,可以采用二进制位检索法依次查找每一个器件。
一旦器件的序列号已知,通过寻址该序列号,就可以唯一地选出该器件进行通信。
所有通信的第一步都需要总线控制器发出一个‘复位’信号以使总线同步,然后选择一个受控器件进行随后的通信,这可以通过选择所有的受控器件或者选择一个特定的受控器件(利用该器件的序列号进行选择)或者通过对半检索法找到总线上的下一个受控器件来实现。
上文所提到的这些指令都是‘网络’指令或者只读存储器 (ROM)指令。
一旦一个特定的器件被选中,那么在下次复位信号发出之前,所有其它器件都被挂起而忽略随后的通信。
一旦一个器件被用于总线通信,主机就能向它发出特定的器件指令,对它进行数据读写。
这是因为每类器件具有不同的功能和不同的用途,而且一旦器件被选定,就有了唯一的协议。
虽然每类器件具有不同的协议和特征,但其工作过程却是相同的并且遵循如图1所示的工作流程。
图1. 典型的1-Wire通信流程每个受控器件的序列号的整数部分是一个8位的家族代码。
Logic IO 1-Wire ID-Button 读取器用户手册说明书

Technical Manual for the1-Wire ID-Button ReaderVersion 2.00Page 1 of 5 Logic IO ApS. Ph: (+45) 7625 0210IntroductionThis manual contains technical documentation allowing easy installation and use of the 1-Wire ID-Button (iButton) reader. Each ID-Button has a unique ID, which makes the identification of persons/items very easy.The ID-Button reader is supported by most RTCU devices available.The 1-Wire bus is a single wire (plus ground) communication bus, which is easy to install as it only consists of two wires. In addition, an LED is located in the middle of the reader for user indication. This LED has a dedicated wire.For information on the software configuration of the RTCU device, please refer to the RTCU IDE on-line help.Page 2 of 5Table of ContentsIntroduction (2)Table of Contents (3)Ordering Information (3)Graphical view (4)Connections (5)RTCU NX-200 / MX2 series (5)Open wire version (5)Ordering InformationRT-O-1W-IDRD3 1-wire ID button reader for the RTCU MX2 / NX-200.Page 3 of 5Graphical view1-Wire ID-Button Reader withopen wires1-Wire ID-Button Reader forthe MX2 / NX-200Page 4 of 5 Logic IO ApS. Ph: (+45) 7625 0210ConnectionsRTCU NX-200 / MX2 seriesThe reader is delivered with a 12-pole connector. Connect this directly to the RTCU NX-200 or the RTCU MX2 device.Open wire versionThe reader is supplied with three wires prepared for connection to screw terminals. The color and function of the wires are listed in the table below:Brown LED indicatorWhite GroundPage 5 of 5 Logic IO ApS. Ph: (+45) 7625 0210。
1-wire总线说明

摘要:本应用笔记介绍了嵌入式应用中的四类1-Wire主机电路,并讨论了它们与备用(即未用)系统资源相关的性能与要求。
文中给出的电路适用于半径不超过1米,只挂接少量1-Wire从器件的小型网络。
文章还介绍了针对具体应用寻找最具性价比的1-Wire主机的指令和决策表。
这里假设读者熟悉1-Wire通信和微控制器的基本知识。
引言1-Wire总线是一个简单的信号传输电路,可通过一根共用的数据线实现主控制器与一个或一个以上从器件之间的半双工双向通信。
电源和数据通信通过单根数据线传输,使得1-Wire器件具有无与伦比的强大功能,可减少系统间的互联。
1-Wire器件通过受专利保护的单触点串行接口提供存储器、混合信号和安全认证功能。
1-Wire器件的典型应用如下:打印墨盒或医疗消耗品的识别;机架卡的校准和控制;印刷电路板、配件及外设的识别和认证;知识产权保护、防克隆、安全功能控制。
采用1-Wire技术时,需要通过1-Wire主机发送信号来识别总线上的器件并与它们通信。
构建一个1-Wire主机有很多方法。
本文讨论了嵌入式应用的主机,包括半径不超过1米且1-Wire 从器件数目不超过三至五的小型网络。
设计1-Wire大型网络或从器件数目较多时,可参考应用笔记148:"1-Wire网络可靠设计指南"。
1-Wire术语首先解释几个1-Wire文档中常见的术语。
主机接口本文讨论的电路为1-Wire主机控制器,它们均与1-Wire从器件通信。
但是,这些1-Wire主机控制器不能作为单独的主体,需要一个主机(计算机)告诉它们在1-Wire侧如何工作。
主机接口指1-Wire主控制器和“系统中更高级的指挥官” (即主机)之间的连接类型。
工作电压通常情况下,1-Wire器件的工作电压范围为2.8V (最小值)至5.25V (最大值)。
多数1-Wire 器件没有电源引脚。
因此,这种器件以寄生供电的方式从1-Wire通信线路获取电源。
1 Wire Harness 安装说明书

Wire Harness Installation InstructionsFor Installing:Part #50005 – 6 Switch / 8 Relay Race Car KitManual #905621st Edition July 2008Copyright © 2008 by Perfect Performance Products, LLC.Painless Performance Products, LLC2501 Ludelle St.Fort Worth, TX 76105-1036PHONE: 800-423-9696 FAX: 817-244-4024EMAIL: ******************************** If you have any questions concerning the installation of this harness, feel free to call Painless Performance Products' Tech Line at 1-800-423-9696. The Tech Line can be reached from 8 A.M. to 5 P.M. central time, Monday through Thursday, and 8 A.M. to 4:30 P.M. on Fridays.We have attempted to provide you with as accurate of instructions as possible and are always concerned about corrections or improvements that can be made. If you have found any issues or omissions, or simply have comments or suggestions concerning these instructions, please write us at the above address, send us a fax at (817) 244-4024, or email us at ********************************. We sincerely appreciate your business.Painless Performance Products, LLC shall in no event be liable in contract or tort (including negligence) for special, indirect, incidental, or consequential damages, such as but not limited to, loss of property damage, or any other damages, costs or expenses which might be claimed as the result of the use or failure of the goods sold hereby, except only the cost of repair or replacement.TABLE OF CONTENTS1.0 Introduction (4)2.0 About These Instructions (4)3.0 Tools Needed (4)3.1 50005 Conten ts (5)4.0 Pre-installation and General Harness Routing Guidelines (5)5.0 General Harness Installation Instru ctions (6)5.1 Grounding the Automobi le (6)5.2 Rough Installation (6)5.3 Harness Attachment (6)5.4 Terminal Installation and Making Connections (7)6.0 General Circuit Connection s (7)6.1 Cooling Fan (7)6.2 Late GM alternato r (7)6.3 One wire alternator (7)6.4 Brake light Switch (8)7.0 Switch Panel Installation and Connec tions (9)7.1 Dash Mounting the Switch P anel (9)7.2 Roll Bar Mounting the Swit ch Panel (9)8.0 Wiring 12 pin connector (9)8.1 Optional Relayed Wire (11)8.2 Testing the System (12)LIST OF ILLUSTRATIONSFigure 3.1 Roll Crimper needed (4)Figure 6.2 Late GM Alternator – Interna l Regulator (8)Figure 6.3 One-Wire with Master Diconnect (8)Figure 8.0 Terminal insertions into connector method (9)Figure 8.1 50005 harness to switch panel connector chart (10)Figure 8.2 General Final Layout Guide WITH DISCONNECT (13)Figure 8.3 General Final Layout Guide WITHOUT DISCONNECT (14)Figure 8.4 Optional Relay Kits and Acce ssories (15)LIST OF TABLESTable 8.1 50005 Wire Connection Index (11)Table 8.2 Fuse Requirements (12)1.0 INTRODUCTIONYou have purchased what we at Perfect Performance Products, LLC believe to be the most up-to-date and easiest-to-install automotive racing wire harness on the market. It is designed for easy installation, even if you have no electrical experience.The 50005 fuse block can be easily attached to any under-dash location. There is enough wire length at all engine, dash, and trunk locations to complete the installation without splicing. The fuse block is pre-wired, allowing easy hookup. The proper fuses and relays have been pre-installed in the fuse block. In addition, all wires are color-coded and printed. This will help you identify the different circuits during installation and later on if additions to the overall system are necessary.The 50005 Race Car Kit was designed with two major groups incorporated into it:Switch panel section: This section includes all of the wiring that will connect the switch panel to the relay bank and fuses. These wires are for the activation of the relays.Accessory section: This section goes to the individual devices in the car. I.E. fuel pump, water pump, electric fans, starter, ignition system, etc.2.0 ABOUT THESE INSTRUCTIONSThese instructions provide information for the installation of the 50005 6 Switch/ 8 Relay Racing Application Wire Harness Kit and the 6 Switch Panel. The contents of these instructions are divided into the following sections:1.0 Introduction2.0 About These Instructions3.0 Tools Needed4.0 Pre-Installation and Harness Routing Guidelines5.0 General Installation Instructions6.0 50005 racing application harness connections7.0 Six Switch Panel ConnectionsSections are further divided into Paragraphs and Steps. Throughout this instruction manual, the Figure numbers refer to Illustrations and the Tables that refer to information for installation. These are located in or near the sections or paragraphs to which they correspond. Always pay special and careful attention to any Notes, especially those in the Tables, and any text marked CAUTION.3.0 TOOLS NEEDEDIn addition to your regular hand tools, you will also need the following special tools:1. Crimping tool for insulated terminals(Note: Use a quality tool to avoid over-crimping.)2. Crimping tool designed for rolled crimps.3. Wire stripper4. Volt/Ohmmeter5. Electric drill6. 1-1/4" Hole saw7. Small (10 amp or less) battery chargerIllustration 3.1 Rollcrimper Radio Shack P/N64-2983 or equivalent3.1 CONTENTS OF THE 50005 WIRE HARNESS KITTake inventory to see that you have everything you are supposed to have in this kit. If anything is missing, go to the dealer where you obtained the kit or contact Perfect Performance Products LLC at 800-423-9696. The 50005 6 Switch/8 Relay Race Car Kit should contain the following items:The Main Wire Harness, with the Fuse Block pre-wired with fuses and relays installed▪ 6 switch panel pre-wired and ready for install▪Connectors and terminals▪Firewall grommet▪10ga red wire for alternator charge wire (rolled)▪ 2 Packages of nylon tie wraps (1 pack of 4 inch and 1 pack 7-inch wraps)▪Parts bag, containing the MIDI fuse▪Race Car Wire Harness Installation Instructions P/N 90562 (This booklet)4.0 PRE-INSTALLATION & HARNESS ROUTING GUIDELINESThe installation of your wire harness kit consists mainly of two parts:▪The physical routing, positioning, and securing of the wire harness, wire groups, and individual wires ▪The proper electrical connection of the individual circuits.These two major tasks are not separate steps, but are integrated together. That is, you will route some wires and make some connections, route some more wire and make some more connections. We cannot tell you how to physically route the harness in your automobile. The routing depends a great deal upon the particular make of automobile and to what extent you want to secure and conceal the harness. We do offer some general guidelines and routing practices starting in Paragraph 4.1, GENERAL installation instructions in Section 5.0, and precise instructions concerning the electrical connections you will make at the beginning in Section 6.0. To help you begin thinking through the installation of your wire harness, read the following sections:4.1Familiarize yourself with the harness by locating each of the harness sections in the following list.Decide where and how the Fuse Block and Switch Panel will be mounted. Painless Performance Wire Harness Kits are designed for the fuse block to be near the dash. You may choose to mount it in the X brace of the door, under the dash, or in dragster applications you may possibly mount it forward of the drivers compartment.4.2Decide which of the following circuits you will be using in your system and where the harnessgroups or wires will be routed. Most common routing is done along roll cage bars, A-pillars, doorsills, or frame rails. A good exercise is to lay out the wire harness on the floor beside yourautomobile and identify all the wires and get a good idea of which wires are going to go where.IfPower Braid has been chosen to sheath the harness it should be applied now! This will make the installation look clean and professional. (Refer at Figure 8.2 page 11 to view the Power Braidoptions). You will want to route the harness through and around open areas. Inside edges provideextra protection from hazards and also provide places for tie wraps, clips and other support.4.3Route the harness away from sharp edges, exhaust pipes, and hood, trunk, and door hinges. Afterthe decision of proper routing has been determined, locate places to support the harness. Generallya support every 12 inches unless the harness routes under the floor carpet.4.4 Allow enough slack in the harness at places where movement could possibly occur (body to frame,frame to engine, etc.). Make sure wire ends don't depend on the terminals to support the harness.The weight of the harness could cause terminals to disconnect. The wires should be bundled intoharness groups. Use nylon ties, poly split loom, or tape to hold wire together. This will keep theinstallation clean and also keep wires from chaffing.5.0 GENERAL INSTALLATION INSTRUCTIONS5.1GROUNDING THE AUTOMOBILEA perfectly and beautifully wired automobile will nevertheless have problems if everything is notproperly grounded.Note: Painless Performance Wire Harness Kits include no ground wire except the black wire from the Switch Panel. You must supply ground wire (14-16 gauge) for all other circuits.Painless Performance suggests a 1gauge Ground Cable from the Negative Battery terminal to theautomobile chassis frame. This will be your common ground point. From the same location route a1gauge ground cable to the engine block. (DO NOT RELY UPON THE MOTOR MOUNTS TO MAKE THIS CONNECTION.) At this point a ground strap should be routed from the common ground point on the frame to the body. Painless Performance offers two different kits to make this installation effortless.The 40100 and 40105 will give the option of factory mount battery or remote mount battery locations.If you have a fiberglass body, you should install terminal blocks to ground all your gauges, lights, and accessories. The terminal blocks work as remote grounding sources. Painless Performance offers the fiberglass body ground kit part # 40026 to make easy work of installing a remote grounding source.5.2 ROUGH INSTALLATIONCAUTION: DISCONNECT THE POWER FROM YOUR VEHICLE BY REMOVING THE NEGATIVE BATTERY TERMINAL FROM THE BATTERY.Note: Your kit comes equipped with a MIDI fuse. This safety device is designed to go between wires #916 and #915 and the battery source for overall harness protection.Note: Make no wire connections or permanent mounting of any kind at this time!Position the Fuse Block and Switch Panel in their intended locations. Drill a 1-1/4" (1.25") hole inthe firewall near the fuse block for engine and headlight group wires to pass through (cooling fan,water pump, ect).Install the firewall grommet. Route engine and headlight group wires throughthe grommet and position the harness groups in the areas decided upon in Paragraphs 4.2.Note:This grommet can also be used to pass your gauge sending unit wires or lines through.5.3HARNESS ATTACHMENTNote: Harness routing and shaping will be a time-consuming task. Taking your time will enhance the beauty of your installation. Please be patient and TAKE YOUR TIME!Permanently mount the fuse block. Make sure that none of the wires are pinched or interfere withthe Fuse/relay Block mountingMold harness groups to the contour of floor pan, firewall, fender panels, and any other area wherewires or harness groups are routed. Remember to route the harness away from sharp edges,exhaust pipes, hood, trunk and door hinges, etc. Attach harness groups to your automobile withclips or ties starting at the fuse block and working toward the rubber grommet for the front groupsand along the floor pan for the rear group. The dash wires should be routed out of the way of anyunder-dash obstacles, such as the cowl vent, radio, etc.Note: Do not tighten tie wraps and mounting devices at this time. Make all harness attachments LOOSELY.attractive assembly. A tie installed in other areas every 6" or so will hold the wires in place nicely.5.4 TERMINAL INSTALLATION AND MAKING CONNECTIONSNote: In the following steps you will be making the circuit connections. Before you start, you should carefully read Sections 6.0 through 7, and continually refer to the wire connection indexes,DOUBLE CHECKING your routing and length calculations before cutting any wires and makingconnections. Give special attention to leave slack in the wire for connecting and disconnecting inthe future.BEFORE YOU START:Have all needed tools and connectors handy.Select the correct size terminal for the wire and stud application.Determine the correct wire length and cut the wire. Remember to allow enough slack in theharness and wires at places where movement could possibly occur, such as automobile body toframe, frame to engine, etc. Double check your calculations.Strip insulation away from wire. Strip only enough necessary for the type of terminal lug you areusing.Note: In the following step, make sure that the terminal is crimped with the proper die in the crimping tool. An improper crimp will NOT make a good connection. DO NOT OVER-CRIMP! Crimp theterminal onto the wire. Connecting the harness throughout the groups is a repeating process. Makesure that each wire is FIRST properly routed and THEN attach. DO NOT ATTACH THE WIREFIRST AND THEN ROUTE AFTERWARD. When all wires are attached, tighten the mounts andties to secure harness permanently.6.0 50005 GENERAL CIRCUIT CONNECTIONS6.1 Cooling FanA circuit breaker has been included in this kit to protect the system from any voltage spikes that may occurduring fan start up. The circuit breaker should be wired inline with the gray/white 901 wire, as close to the fuse/relay block as possible.6.2 Late GM Alternator (after 1972) Internal Regulator. See Figure 6.2.A. Connect ENGINE SECTION ignition hot (I.E. a branch off of the 931 pink wire) to alternatorterminal #1. Connect ENGINE SECTION wire (red) (shown in diagram 6.2 on page 5) to thealternator output lug (Bat).B. Connect a short 10-gauge jumper wire from alternator terminal #2 to the alternator output lug (Bat).C. A connector and terminal spades for late GM Alternators are included in the parts bag.6.3 GM One-Wire AlternatorsA. Connect an 8gauge wire to the Alternator Output lug then route to the B+ side of the starter. No wireswill be attached to the 1 or 2 postsB. When using a Delcotron1-wire alternator you must use a voltmeter. A warning light cannot be wired in.A warning light may be used when using a Painless PowerStar alternator.Figure 6.2 Late GM alternator with internal regulatorFigure 6.3 One-wire with Master DisconnectNote: Your Alternator may not appear exactly as represented in the Figures, but the circuits are wired the same.Note: When using an alternator in a racing application most sanctioning bodies require the charging system to be wired so that when you shut off the master switch at the back of the car the power tothe entire car will be shut down. Refer to the full schematic shown above.6.4 Brake Light SwitchA brake light as required by some classes, use the #954 white wire to supply power to the brakeswitch. A wire from the brake switch to the lights at the back of the car will need to be added to theinstallation. This wire may also be used to power a delay box. DO NOT power delay box off of arelay.7.0 SWITCH PANEL INSTALLATION AND CONNECTIONSNote: See figure 8.0 for the correct method of terminal insertion into the connectors.7.1 Dash mounting the switch panel.A. Mount the Switch Panel in the desired location by drilling holes in the dash to suit yourneeds. When dash mounting this switch panel you will not use the provided switch panel rearcover. Four (4) mounting screws are provided. Be sure you have threaded the wires throughany holes and grommets before installing the connectors. The electrical contacts are almostimpossible to remove without damage once they have been inserted into the connector body.7.2 Roll bar mounting the switch panel.The switch panel chassis has been designed for large hose clamps to be routed through the backand around the roll bar for easy mounting.Note: The box is pre-punched to allow the switch panel wires to exit from any chosen side. The rubber grommet is provided to protect the wires as they exit from the box. Cap plugs areincluded to plug the remaining unused holes.Attach the switch panel to the box with the four (4) screws provided, routing the wires throughthe grommet and out the desired hole. Be sure you have threaded the wires through any holesand grommets before installing the connectors. The electrical contacts are almost impossible toremove without damage once they have been inserted into the connector body.8.0WIRING12 PIN CONNECTOR.The fuse/relay box connector will come pre-wired. After you determine the location that the switch panel will be mounted you will now know how much length will be needed to make connection between the fuse/relay box and the switch panel. After deciding length start stripping the wires and terminating switch panel pigtail. Make sure the correct wires are applied to the specific pinhole that is specified.Figure 8.1 50005 harness to switch panel connector chart8.1 OPTIONAL RELAYED WIREGreen 968 is a power-activated wire for accessory 2 relay. The circuit is pre-wired from the fuseblock to the S1 connector. If the circuit is needed, terminate the wire and insert terminal in the #9cavity in the P-1 connector. The circuit is now ready to wire to the device desired. The accessoryswitch will activate the circuit. This can be used for line locks, nitrous, Trans brake, etc. (20amp max circuit)Table 8.2 Fuse Requirements8.2 TESTING THE SYSTEMCAUTION: IF YOU HAVE NOT YET DISCONNECTED THE BATTERY FROM THE AUTOMOBILE, DO SO NOW! DO NOT CONNECT THE BATTERY CHARGERWITH THE BATTERY CONNECTED. YOU WILL SIMPLY DEFEAT THEPURPOSE OF USING THE CHARGER.Use a small (10 amp or less) battery charger to power up the vehicle for circuit testing. If there is a problem anywhere, the battery charger's low amperage and internal circuit breaker will provide circuit protection. Connect the battery charger's NEGATIVE output to the automobile chassis or engine blockand its POSITIVE output to the automobile's positive battery terminal.Individually turn on each light, ignition, wiper circuit, etc, and check for proper operation.When all circuits function properly, attach the battery cable to the battery for vehicle operationFigure 8.2 General final layout guide WITH DISCONNECTFigure 8.3 General final layout guide WITHOUT DISCONNECTPainless Performance Products, LLCLimited Warranty and Return Policy Chassis harnesses, fuel injection harnesses, and Trail Rocker units are covered under a lifetime warranty.All other products manufactured and/or sold by Painless Performance are warranted to the original purchaser to be free from defects in material and workmanship under normal use. Painless Performance will repair or replace defective products without charge during the first 12 months from the purchase date. No products will be considered for warranty without a copy of the purchase receipt showing the sellers name, address, and date of purchase. You must return the product to the dealer you purchased it from to initiate warranty procedures.。
DS28E18 1-Wire到I2C SPI桥评估系统一般描述说明书

DS28E18EVKIT#Evaluates: DS28E18DS28E18 Evaluation System General DescriptionThe DS28E18 evaluation system (EV system) provides the special hardware and software system to exercise the fea-tures of the DS28E18 1-Wire ®-to-I 2C/SPI bridge with com-mand sequencer IC. The EV system consists of a DS28E18 EV kit board, a DS7505 peripheral module board, a MAX31722 peripheral module board, and a DS9481P-300# USB-to-1-Wire adapter for PC connectivity. The EV kit is compatible with Windows ® operating systems.EV System Contents●DS28E18 EV kit board (Figure 1) ●DS9481P-300# USB-to-1-Wire adapter ●MAX31722 PMOD board ●DS7505 PMOD boardFeatures●Driver Support for Windows 10/8/7 ●Fully Compliant with USB 2.0 Specification ●USB Powered with No External Power SupplyRequired ●Extended SPI/I 2C Peripheral Module Connector forRapid Prototyping of SPI/I 2C Slaves319-100556; Rev 0; 6/20Ordering Information appears at end of data sheet.1-Wire is a registered trademark of Maxim Integrated Products, Inc.Windows is a registered trademark of Microsoft Corporation.Figure 1. DS28E18 EV Kit BoardFigure 2. DS9481P-300# USB-to-1-Wire AdapterClick here to ask about the production status of specific part numbers.Evaluates: DS28E18DS28E18 Evaluation System Quick StartRequired Equipment●DS28E18 EV kit (included)●DS9481P-300# USB-to-1-Wire adapter (included) ●PC with a Windows 10/8/7 (32-bit or 64-bit) operating system and a spare USB 2.0 or higher port ●1-Wire drivers●DS28E18 EV kit softwareNote: In the following sections, software-related items are iden-tified by bolding. Text in bold refers to items directly from the EV kit software. Text in bold and underlined refers to items from the Windows operating system.ProcedureThe EV kit is fully assembled and tested. Follow the steps below to verify board operation:1) Install the 1-Wire drivers as shown in Figure 7, Figure 8,and Figure 9.2) Attach the DS9481P-300# adapter to the DS28E18EV kit (Figure 6).3) Obtain the latest version of the DS28E18 EV kitsoftware.4) Unzip and save the EV kit software to a known location.5) Open the DeviceDriver folder.6) Right-click on install.bat and then choose Run asadministrator (Figure 7).7) A command window opens with a prompt asking toinstall the device driver (Figure 8). Click Install .Figure 5. Typical SetupFigure 3. MAX31722 PMOD BoardFigure 4. DS7505 PMOD BoardDS28E18 EV Kit FilesPC USB PORT DS9481P-300#DS28E18 EV KITI 2C/SPI PMODFILE DESCRIPTION DS28E18 EV KitEV kit softwareEvaluates: DS28E18 DS28E18 Evaluation System8) Open the folder where the DS28E18 EV kit softwarewas extracted and double-click the Setup.exe file.9) Plug the USB cable to the DS9481P-300# adapter.10) Insert the DS9481P-300# into a spare USB port onthe PC.11) The device will automatically search for and installthe driver (Figure 9).12) To start the evaluation software, ensure that theDS9481P-300# has been properly installed and the DS28E18 board and DS9481P-300# adapter areconnected.Run the DS28E18 EV kit software: Start→ Pro-grams → Maxim Integrated → DS28E18EV Kit 13) If the DS9481P-300# is not detected or connectedto the USB port, the software displays an errormessage (Figure 11). Close the program window,reconnect the DS9481P-300# adapter, and restart the program again.14) Once properly installed, the initial screen graphicaluser interface (GUI) should appear (Figure 12).Figure 6. DS9481P-300 Attached with DS28E18 EV Kit BoardFigure 7. Device Driver InstallationEvaluates: DS28E18DS28E18 Evaluation System Figure 9. Device Driver Successfully InstalledFigure 10. Opening the DS28E18 Evaluation Program SetupFigure 8. Device Driver (Install Device Software)DS28E18 Evaluation SystemEvaluates: DS28E18Figure 11. DS9481P-300# Error MessageFigure 12. DS28E18 EV Kit Software Initial Screen GUIEvaluates: DS28E18 DS28E18 Evaluation SystemDetailed Description of SoftwareThe DS28E18 evaluation program user interface (Figure 12) has two tabs: 1-Wire to I2C/SPI and Settings. The 1-Wire to I2C/SPI tab is the main tool to evaluate specific functions of the DS28E18. The Settings tab (Figure 13) provides control over the device’s general and GPIO configurations.Figure 13. DS28E18 EV Kit Software, Settings TabEvaluates: DS28E18 DS28E18 Evaluation System1-Wire to I2C/SPI TabThe DS28E18 EV kit board provides a peripheral module connector designed for attaching either an I2C or SPI slave. To help communicate with attached slave devices, the 1-Wire to I2C/SPI tab provides the following controls: Find Devices, Sequencer Commands, Sequencer Memory List, Device Function Commands, and Get Temp. See Table 1 for more details on each control.Settings TabThe Settings tab provides the necessary controls for configuring the devices’ general and GPIO settings. See Table 2 for more details on each control.Table 1. 1-Wire to I2C/SPI ControlsTable 2. Settings ControlsELEMENTNAME DESCRIPTIONDevice Used for writing or reading the DS28E18’s general configuration. Select between the Device Function Command options to specify action. Customize the desired configuration with the available drop-down boxes (only available when Write Configuration (55h) is selected). Must click the Execute button to perform an action.GPIO Used for writing or reading the DS28E18’s GPIO Control and Buffer configuration. Select between the Device Function Commands and register options to specify an action. Customize the desired configuration using the available drop-down boxes (only available when Write GPIO Configuration (83h) is selected). Must click the Execute button to perform an action.ELEMENTNAME (TYPE)DESCRIPTIONFind Devices (Action button)Triggers the Search ROM command and powers up all discovered devices after adding them to the Device List box. See the log for a detailed flow of the power-up sequence.Get Temp (Action button)Example flow for getting temperature from either the DS7505 or MAX31722 peripheral module boards included with the kit using the DS28E18. Only available after clicking Find Devices. T o select between modules, configure the device Protocol under the Settings tab. See the DS7505 or MAX31722 data sheet for product specific details and sequences.Sequencer Commands (Action buttons)Controls used in conjunction with the Sequencer Memory List to build I2C/SPI sequences. Only available after clicking Find Devices. To avoid mixing sequences, only one tab can can be used between I2C and SPI controls. To select between I²C and SPI controls, configure the device Protocol under the Settings tab.Sequencer Memory List (Data Grid)Table used in conjunction with the Sequencer Commands controls to build I2C/SPI sequences. Each sequencer command populates and updates this table with its respective command structure recognized by the DS28E18. Data displayed in this list does not reflect the actual data found in the DS28E18 memory and is just a tool used to help manipulate data with the device function commands.DeviceFunction Commands (Action buttons)Controls used in conjunction with the Sequencer Memory List to manipulate the DS28E18 memory. Click the Select All button, or manually enter the desired address in Address Range box, to specify the location in memory to Write to or Read/Run from. Select between three different device function commands:Write Sequencer (11h) - Writes the data from the highlighted address into the actual memory address.Read Sequencer (22h) - Reads the actual data that resides in memory address highlighted.Run Sequencer: (33h) - Runs the actual data that resides in memory address highlighted.Must click the Execute button to perform an action.Evaluates: DS28E18DS28E18 Evaluation System Detailed Description of HardwareFor more information on jumper configurations, see Table 3.Table 3. Jumper Settings#Denotes RoHS compliant.JUMPER SETTING DETAILSJB1Open Enable LED, D1 toggle control through GPIOAClosed Disable LED, D1 toggle controlJB2Open Enable LED, D2 toggle control through GPIOB Closed Disable LED, D2 toggle controlJB3Open DS28E18 powered through DS9481P-300 3.3V supply Closed DS28E18 powered parasitically through DS9481P-300 1-Wire JP4OpenNo power being supplied through 12-pin female connector 3.3V and VDD 3.3V power being supplied through 12-pin female connector SENS and VDDSENS_VDD power being supplied through 12-pin female connectorOrdering InformationPART TYPE DS28E18EVKIT#EV systemEvaluates: DS28E18 DS28E18 Evaluation SystemDS28E18 EV Kit Bill of MaterialsMaxim Integrated │10 Maxim Integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim Integrated product. No circuit patent licenses are implied. Maxim Integrated reserves the right to change the circuitry and specifications without notice at any time.Maxim Integrated and the Maxim Integrated logo are trademarks of Maxim Integrated Products, Inc.© 2020 Maxim Integrated Products, Inc. │ 11REVISION NUMBERREVISION DATE DESCRIPTION PAGES CHANGED 06/20Initial release —Revision HistoryFor pricing, delivery, and ordering information, please visit Maxim Integrated’s online storefront at https:///en/storefront/storefront.html.DS28E18EVKIT#。
应用笔记192:DS2480B串行接口1-Wire线驱动器的使用

引言1-Wire ®通信协议可以通过微处理器上的一个IO 引脚产生,不过,为了创建可靠的1-Wire 网络,必须提供正确的时序和适当的输出电压摆率。
1-Wire 主机发送的时序不正确会导致与1-Wire 从器件之间的通信间断或完全失败。
输出电压摆率若不加以控制,可能严重限制网络的长度,并产生时通时断的现象。
如果可以提供串行通信UART ,那么通过一个串口至1-Wire 桥接器(DS2480B)就可以解决上述问题。
DS2480B 是从串行接口到1-Wire 网络协议转换的桥接器。
只要主机具有普通的串行通信UART ,就可以通过该桥接器产生严格定时和电压摆率控制的1-Wire 波形。
DS2480B 接收所要发送的指令与数据,执行1-Wire 操作,并将结果返回至主机。
图1给出了DS2480B 配置的简化框图。
实现该协议并浏览所有的DS2480B 指令可能需要花大量的时间并容易混淆。
为此,本指南将介绍通用的1-Wire 操作,并解释DS2480B 的输入串行数据包结构,以及输出串行数据包的含义。
本文作为DS2480B 数据手册的补充,并不能代替数据手册。
该数据手册可以在网页/中找到。
DS2480B 的使用(简化) 图1与该桥接器一起工作的主机UART 至少应能够支持8位、无奇偶校验、9600波特(位/秒)的通信。
该桥接器可以实现更高的数据速率,最高可以达到115200波特,但是上电时以9600波特启动。
DS2480B 数据手册中介绍了电气方面的注意事项,如RS232。
1-Wire 接口只有在所有指令与模式均被转换到1-Wire 通信接口,使得各种应用能够基于该接口使用,DS2480B 才是有用的。
为了执行1-Wire 操作,应用中必须具备的一些基本1-Wire 函数。
第一项操作是使总线上所有1-Wire 从器件复位,为接收来自1-Wire 主机的指令做好准备。
第二项操作是从1-Wire 主机向从器件执行写一位操作,第三项操作是从1-Wire 从器件中读一位操作。
DALLAS MAXIM OneWireViewer 说明书, V1.3

OneWireViewer用户指南, V1.3引言OneWireViewer是一个基于Java语言的Dallas 1-Wire器件软件开发包,支持不同的硬件和软件平台。
与1-Wire器件的通信遵循1-Wire协议,通过单根数据线和地线即可完成。
由1-Wire器件组成的网络称为1-Wire网络或MicroLAN。
提供串口、并口和USB端口的1-Wire适配器。
所有支持的平台都能够采用基于DS2480B 芯片的串口适配器。
对于Windows (32位)系统,提供其它类型的适配器,应用于串口、并口和USB端口。
概述与类似的iButton浏览器程序相比较,OneWireViewer不是针对于某个特定平台的可执行编译代码,而是采用Java编程语言。
其编译器为已有的特定平台或运行环境(RTE)所产生的二进制代码,可定向于不同的平台。
因此,计算机上安装RTE是OneWireViewer运行的前提条件。
RTE可以从网站免费下载。
由于“单纯Java”不包括访问硬件通信端口的驱动程序,因此这些驱动器程序,也称为“本地 Java”,需要到网站下载,这些驱动程序支持多种操作系统和串行端口。
OneWireViewer 是一种“living software package”,也就是说,可能会不进行特别通告就会随时更新。
为了保证用户所使用的永远是最新版本,OneWireViewer 采用Java Webstart来启动,Java Webstart是一种特殊的机制,Java 2 RTE 1.4.x版或更高版本均支持。
如果Webstart已接入互联网,它会自动访问站点,并在发现OneWireViewer更新程序后自动下载。
同样,如果直接通过点击“Launch the OneWireViewer”按钮来运行OneWireViewer的话,也可随后进入iButton 站点/software/1wire/OneWireViewer.html下载该软件的最新版本。
Modular 1-Wire Concept 技术手册说明书

Modular 1-Wire Concept Technical ManualRevision 1.02IntroductionThis technical manual introduce how to install and use the modular 1-Wire network for X32 based RTCU units. The network protocol is the well known 1-Wire®1 from Maxim/Dallas Semiconductors. Information on the possibilities and limitations using the 1-Wire on RTCU units will be explained also information on the tool free installation.Currently the supported 1-wire products are the iButton®1 identification key, with and without on-board memory and a temperature sensor. Other products may be supported in future please consult Logic IO for more information. All the supported 1-Wire products are available directly from Logic IO.The iButton is a unique, factory-lasered and tested 64-bit registration number that assures absolute traceability because not two parts are alike. It comes in a small metal MicroCan that is very robust even in harsh environments. In order to read the iButton a special reader must be used. The reader is attached to the 1-wire bus and connects the iButton to the 1-wire bus. A small key-ring (iButton Fob) adapter is available so the iButton is easier to carry and place in the reader.The temperature sensor is a small wide-range (–55°C to +125°C) temperature sensor, which requires no external power (it derives its power directly from the 1-wire bus, called parasitic power). This makes remote temperature sensing in various places very easy.MX2i pro+MX2i proMX2i eco+DX4 proDX4 flexDX4 ecoAX9 proAX9 pro-xAX9 ecoAX9 eco-xCX1i proCX1i flex1 1-Wire® and iButton® are registered trademarks of Maxim/Dallas Semiconductors.Page 2 of 12Ordering InformationRT-O-1WM-IF1 Interface cable for the DX4, AX9 SeriesRT-O-1WM-IF2 Interface cable for the MX2i unitRT-O-1WM-IF3 Interface cable for the CX1i SeriesRT-O-1WM-TEMP3 Temperature sensor cable, 3mRT-O-1WM-TEMP10 Temperature sensor cable, 10mRT-O-1WM-IDRD3 ID-Button Reader cable, 3mRT-O-1WM-IDRD10 ID-Button Reader cable, 10mRT-O-1W-ID1 iButton – Unique identification ID buttonRT-O-1W-ID2 iButton – Unique identification ID button with 116 bytes of memoryRT-O-1W-FOB1 ID-Button HolderRJ45-CMB RJ45 Combiner for modular 1-Wire networkRJ45-SPL2 RJ45 1:2 Splitter for modular 1-Wire networkRJ45-UTP-02MB 2m UTP cable, blackRJ45-UTP-03MB 3m UTP cable, blackRJ45-UTP-05MB 5m UTP cable, blackRJ45-UTP-07MB 7m UTP cable, blackRJ45-UTP-10MB 10m UTP cable, blackRJ45-UTP-15MB 15m UTP cable, blackInstallationInstallation of the modular 1-wire network can be done without the use of any tools,using standard of the shelf RJ-45 cables, splitters and/or combiners allowing multi device network installation.The delivered interface cable for the selected RTCU ends in a RJ45 plug, from this point use cable splitters or combiners to attach 1-Wire devices onto the network.Example of a modular 1-Wire network with two temperature sensors and one ID-Button Reader:Page 3 of 12Modular 1-WireUnit interface cables that connects the RTCU unit to a splitter or combiner, that again connects to branches with more splitters and combiners and at the end-points of this arbitrary topology various lengths of 1-Wire devices such temperature sensors or ID-button readers can be connected. As the backbone is based on standard RJ45 UTP cable technology expanding a network can easily be achieved. Modular Temperature Sensor (RT-O-1WM-TEMP3 / RT-O-1WM-TEMP10)The modular 1-wire Temperature Sensor features an easy to install and easy to use digital thermometer. The sensor offers an accuracy of typical +/- 0.5ºC and ranges from –55ºC to +125ºC.RJ45 Connections:1-Wire Data Pin 6 (green)Ground Pin 4 (blue)Page 4 of 12Modular ID-Button reader (RT-O-1WM-IDRD3 / RT-O-1WM-IDRD10)The modular 1-wire ID-Button reader features an easy to install and easy to use modular 1-Wire ID-Button reader with controllable LED indicator. The ID-Button reader offers a way to uniquely identify persons or items equipped with ID-Buttons.RJ45 Connections:1-Wire Data Pin 6 (green)1-Wire LED Pin 2 (orange)Ground Pin 4 (blue) + Pin 5 (blue/white)Page 5 of 12Page 6 of 12Modular 1-Wire interface cables (RT-O-1WM-IF1 / RT-O-1WM-IF2 / RT-O-1WM-IF3)The modular 1-wire interface cable makes the physical bridge to the modular 1-Wire network. TheModular 1-Wire interface cable is available in two versions: For the MX2i series (RT-O-1WM-IF2), for the DX4/AX9 series (RT-O-1WM-IF2) and for the CX1i series (RT-O-1WM-IF3). In the package of RT-O-1WM-IF3 heat shrink solder tube are included for easy connection to the RTCU CX1i series interface cable.RT-O-1WM-IF2RT-O-1WM-IF1RT-O-1WM-IF3RT-O-1WM-IF2 Tyco connection:1-Wire Data Pin 11-Wire LED Pin 7Ground Pin 2RT-O-1WM-IF1 flying leads connection:1-Wire Data green + green/white1-Wire LED orange + orange/whiteGround blue + blue/whiteRT-O-1WM-IF3 flying leads connection:1-Wire Data green + green/whiteGround blue + blue/whiteRJ45 connection:1-Wire Data Pin 6 + 3 (green + green/white)1-Wire LED Pin 2 + 1 (orange + orange/white)Ground Pin 4 + 5 (blue + blue/white)Page 7 of 12Modular 1-Wire network accessories:UTP network cable and the cable combiner and splitter below make almost any 1-Wire network configuration possible.RJ45-CMB RJ45-SPL2RJ45-UTP-02MBRJ45-UTP-03MBRJ45-UTP-05MBRJ45-UTP-07MBRJ45-UTP-10MBRJ45-UTP-15MBPage 8 of 12Page 9 of 121-Wire busIt’s important to understand that the 1-Wire bus is a very complex thing, even though it only consists of only two wires; the communication form and the communication speed will set a high demand for correct cabling and load of the bus. Every 1-Wire network behaves differently due to the variation in cable length, the amount of devices (load) on the bus and the surrounding environment.TopologyWhen configuring 1-Wire hardware and transmission lines (the 1-Wire bus) certain terminologies are used; these terms are circuit topology, radius and weight.Circuit topology is the way to describe how the circuit is coupled. There are three topologies Linear, stubbed and star.Figure 1 - Linear topology networkFigure 2 - Stubbed topology networkFigure 3 - Star topology networkThe three topologies will behave differently due to signal reflections etc. The most reliable topology is the linear topology but sometimes it’s not possible to obtain this topology. When the three topologies are mixed the circuit becomes even more complex and it’s very hard to predict how reliable the network will be.Page 10 of 12Radius and WeightOther terms like radius and weight are used to describe the length and load of the 1-wire bus. The radius describes the total length of the bus. The 1-wire protocol has a radius limitation of 750-meters due to timing, but the RTCU units only support a total radius of approximately 65-metes.If a linear topology is used and four devices are attached each with 1-meter space in-between the total radius of the network is the length to the furthest device i.e. 4-meter.Figure 4 - Weight and radius of the networkThe weight of the network consists of two things; the total amount of cable and the number of devices. Every time a 1-wire device is attached to the network it adds some weight due to its capacitance. An iButton add a weight of 1-meter and a temperature sensor adds 0.5 meter. In the linear topology case the weight of the cable would be 4-meter and with four temperature sensors attached the total weight will be 6-meters.The RTCU unit is designed only for short and medium range networks. As mentioned earlier the RTCU-unit supports a radius of approximately 65 meters and a maximum weight of 65 meters. When a linear topology is used it is possible to have 64.5 meters cable and a single temperature sensor. See examples in the table 1 below.Max Weight [m] Cable [m] Device Weight [m] Total Weight [m]65 64,5 0,5 = 1 temperature Device65 65 57 8 = 16 temperature Device 65 65 49 16 = 32 temperature Device 65Table 1 - Examples on how to determine the weight of a 1-wire networkThe total weight of the network must not exceed the maximum allowed weight i.e. 65m. The bus should not be routed together with high power signals like the mains supply or other equipment that will have electrical influence on the 1-wire signal.It’s advisable to read the Maxim Application note “App Note 148: Guidelines for Reliable 1-Wire Networks” which can be downloaded from Page 11 of 12SoftwareFunctions for the 1-Wire are implemented in the RTCU-IDE; these are:owSearch Search for 1-Wire DevicesowTempGetIDGet the ID of a specific temperature sensor owTempGet Get the temperature from a specific deviceowiButtonGetIDQuery iButton for its ID owiButtonReadData Read data from a iButton with on-board memory owiButtonWriteData Write data to an iButton with on-board memory owiButtonEnableLED Enable or disable the use of iButton Reader LED owiButtonSetLed Control the iButton LEDPlease refer to RTCU IDE online-help for how to use theses functions and code examples.iButtonThe owiButtonGetID function will return a string with the iButton ROM-number in hex format. In order to use the function it’s necessary to know the ROM-number of the iButton. The ROM-number can be read on the top of the iButton. Please see figure 5. All twelve digits have to be read.Figure 5 - iButton ROM-numberThe ROM-number from figure 5 is 000000FBD8B3. When an iButton is used the ROM-number can be compared to a known one to clarify if the iButton has a valid ROM-number or not.It cannot be determined when a user places an iButton in the reader; therefore it is important to call the owiButtonGetID function very often, so the user won’t experience a delay before the iButton is read. Make sure not to have more time-consuming tasks in the main program loop than necessary.The iButton reader is supplied with a LED that easily can be used to inform the user if the iButton placed in the reader was valid or not.Please notice that it’s only possible to have ONE iButton connected to the 1-wire bus at a time.Temperature sensorEach temperature sensor has a unique ROM-number like the iButton. This number is used to point out one of up to 32 temperature devices, which is the maximum capability of the RTCU-unit.Before any temperature measurement can be carried out the ROM-number has to be discovered. By using the 1-wire search function all temperature sensors on the 1-wire bus are discovered and all the ROM-numbers are stored in a temporary list placed inside the RTCU unit. When the unit is powered off the list is erased and a new search has to be performed on power on. The devices are sorted with the lowest ROM-number first. If a device is removed from the bus all devices with a higher ROM-number will move one number down the list when a new search is carried out. The search function returns the number of devices found.As the search function is intended for generally 1-Wire use, the family number has to be supplied when making the function call. For 1-wire temperature devices the family number is 1.After the 1-wire search is done the temperature from each device on the bus can be read. Use the 1-wire get temperature function to read the temperature from a device. Place the number (between 1 and the number returned by the 1-wire search function) of which temperature sensor is to be read.The temperature sensors retrieve its power directly from the 1-wire bus this is called parasitic power and no external power is needed for remote temperature sensing. A temperature conversion takes approximately 0.8 → 1.0 seconds in this mode. This is due to the power needed for a temperature conversion when operating in parasitic mode.Please Notice and be aware ofAs mentioned earlier the 1-wire network is very complex and sensitive for interruptions. If an interrupt or any interactions interfere with the bus while a communication or a device search is performed it may result in an erroneous reading, termination of device search or devices that are not discovered and/or accessed correctly. The more often a 1-wire device search is done the more it’s likely that a device is left out due to interrupts on the bus. This will for the temperature sensors result in a different organized list of ROM-numbers and the user will experience a reading of another temperature sensor than expected or an “-1” error (device not known) if it was the device with the highest ROM-number that was left out.Page 12 of 12。
长线1-Wire网络可靠设计指南

设计指南148长线1-Wire网络可靠设计指南Aug 25, 2004摘要:1-Wire®协议设计的初衷是为相邻器件的短距离连接提供一种便利的通信方式,1-Wire还提供了一种通过微处理器单个端口增加辅助存储器的途径。
在以后的应用中,1-Wire协议被扩展到网络系统,通信范围超出了电路板尺寸。
本文从多个方面讨论了保证1-Wire网络可靠运行的设计指南。
附录中说明了精确调整1-Wire总线接口的方法,并列举了不同条件下的1-Wire 通信波形。
概述1-Wire协议设计的初衷是为相邻器件的短距离连接提供一种便利的通信方式,例如通过微处理器的单个端口增加辅助存储器功能。
随着1-Wire器件应用的普及,1-Wire协议被扩展到网络系统,通信范围超出了电路板尺寸。
1-Wire网络是器件、电缆和线路连接的复杂组合。
每个网络在拓扑(布局)和硬件上通常都不相同。
网络中器件(例如主机、网络电缆、1-Wire从机器件、“从机”)的正确匹配是1-Wire可靠运行的前提。
当总线主机设计不当或应用不当,或者在近距离通信的主机中使用了很长的通信电缆,通常都不会得到令人满意的性能。
该应用笔记给出了在不同类型、不同网络规模情况下,1-Wire网络的运行结果。
它还提供了网络可靠运行的工作参数。
这里讨论的有些问题对于近距离应用并不严格。
例如,长度小于1米的网络。
关于嵌入式1-Wire应用的讨论,请参考应用笔记4206:“为嵌入式应用选择合适的1-Wire主机”。
附录A到D说明了精确调整1-Wire总线接口的方法,并列举了不同条件下的通信波形。
网络说明本文仅限于使用5类铜缆双绞线的情况,主机提供5V总线电源为1-Wire网络供电(大部分1-Wire从机器件工作在较低的总线电压下,但大型网络在低压状态下工作性能会受到很大影响)。
本文没有涉及EPROM型从机器件的编程,这些器件不推荐用于距离主机终端接口较远的场合。
本文也不讨论1-Wire器件的高速运行模式,高速运行模式只适用于距离非常短的近距离通信,对1-Wire网络不适用。
Wirepath Surveillance DVR Crestron 驱动程序说明书

WPS-DVR Crestron Driverspg. 1© 2012 Wirepath™ Surveillance Rev: 120926-1450OverviewThe following information outlines the use of the Crestron modules for communication via RS232 and TCP-IP with Wirepath ™ Surveillance DVRs. Read through all information before using these modules.Module DetailsRelease Date: 9/26/12 Release Version: v1Supported Wirepath™ Products:WPS-100-DVR-4CH WPS-100-DVR-8CH WPS-300-DVR-9CH WPS-300-DVR-16CHSupported Wirepath™ Software Version: 7.80.53 Build #1 (4CH and 8CH) 7.80.53 Build #2 (9CH and 16CH)Supported Crestron Processors: Crestron Series 2 Crestron Series 3Supported Crestron Applications:SIMPL Windows System BuilderPort Configuration and SettingsThe WPS-DVR receives control data on pin 3 (RxD – Data Receive) and transmits control data on pin 2 (TxD - Data Transmit). The connection cable between the WPS-DVR and the Crestron Processor will need to be configured so that pin 3 (RxD) on the WPS-DVR is connected to the Crestron Processors Txd pin, and pin 2 (TxD) on the WPS-DVR is connected to the Crestron Processors RxD (Receive Data) pin.Note: Configuration for the Crestron Processor control ports can vary. Refer to the documentation for the Crestron Processor being used to ensure proper connection and configuration. ∙ Do not connect any other pins.∙ Do not use a factory made cable unless you know that only pins 2-3-5 are populated.RxD (Data Receive)TxD (Data Transmit)GNDWPS-DVR RS232 DSUB9Male ConnectionWPS-DVR Crestron Drivers Usage Guidepg. 2 Support: 866.838.5052System Builder SupportOnce the module is added to SystemBuilder, you will need to make all the appropriate connections to the system logic and touch panel template that you are using. 1. Drop the modules into your default User Module path.o Wirepath_DVR(Ethernet)_v1.umc oWirepath_DVR(Serial)_v1.umcThis path can be found under EDIT>PREFERENCES>USER DATABASE PATHS. Once you have placed the modules in the appropriate folder, be sure to click rebuild. 2. Next open up your project and select the Equipment view. 3. In the lower right hand corner, open the UserDatabase and drill down the By Device Type until you see SnapAV. 4. Expand the category until you see the WPS-DVR. 5. Right click WPS-DVR(Ethernet) or WPS-DVR(Serial)and select add to system.Once you have added the object to yourprogram, you have to setup the parameters for the module.6. Right click on the object and select Properties.Then select I/O Assignment from the left hand pane. Here you should verify that the Serial or IP settings are correctly set on the I/O tab. Also, for the Ethernet version, make sure to fill out the parameter values on the properties tab. 7. Next select Audio from the left hand pane andverify that this is NOT defined as a distributed audio source.WPS-DVR Crestron Drivers Usage Guidepg. 3© 2012 Wirepath™ Surveillance Rev: 120926-1450Signal and Parameter DescriptionsDigital Inputs[dvr_n0] – [dvr_n16] Numeric camera selection[dvr_four_window] Selects the 2x2 grid camera display on the monitor [dvr_nine_window] Selects the 3x3 grid camera display on the monitor[dvr_sixteen_window] Selects the 4x4 grid camera display on the monitor. (For 16 input DVRs) [dvr_star_mark] Functions as the */Mark button on the IR remote [dvr_pound_code] Functions as the #/code button on the IR remote [dvr_alarm_reset] Resets alarm output[dvr_mode] Toggles through DVR modes[dvr_sequence] Toggles video output between static output and sequence output [dvr_call] Pulse for this DVR function[dvr_search] Displays the on-screen search menu [dvr_record]Pulse for this DVR function[dvr_scan-] [dvr_scan+] Scans forward or backwards during playback [dvr_single_step] Advances one frame at a time during playback [dvr_play_pause] Toggles playback between play and pause [dvr_stop] Stops playback[dvr_copy] Displays the on-screen copy menu [dvr_menu]Displays the on-screen system menu [dvr_escape_ptz] Leaves camera PTZ mode [dvr_mute_next] Pulse for this DVR function [dvr_x2_goto]Pulse for this DVR function[dvr_up-backspace] Functions as the Up/BS button on the IR remote[dvr_down_delete] Functions as the down/DEL button on the IR remote[dvr_left] [dvr_right] Functions as the Left or Right arrow keys on the IR remote [dvr_enter]Functions as the enter key on the IR remote [dvr_volume+] [dvr_volume-] Raises or lowers the audio output level [dvr_minus] [dvr_plus] Pulse for this DVR function [dvr_main_aux_on] [dvr_main_aux_off]Pulse for this DVR function[dvr_call_aux_on] [dvr_call_aux_off] Pulse for this DVR function[dvr_up_left] [dvr_down_left] Functions as the up-left and down-left keys on the IR remote [dvr_up_right] [dvr_down_right] Functions as the up-right and down-right keys on the IR remote [dvr_alarm_out_on] [dvr_alarm_out_off]Turns the alarm output on or offdvr_tcpip_client_connected (Ethernet version only) Route from the connect-f signal of the TCP-IP client symbol for the DVRdvr_connect (Ethernet version only) Pulse to begin a telnet connection and login to the DVR.dvr_disconnect(Ethernet version only) Pulse to end telnet communication with the DVRAnalog Inputsdvr_tcpip_status(Ethernet version only) Route from the TCP-IP client symbol for the DVR. Tracks connection status between the Crestron processor and the DVR.Serial Inputsdvr_rx$ (Ethernet version only) Connect to the rx$ line of the tcp-ip client symbolWPS-DVR Crestron Drivers Usage Guide© 2012 Wirepath™ Surveillance120926-1450Digital Outputsdvr_tcpip_client connect (Ethernet version only) Tie to the connect line of the TCP-IP client[dvr_tcpip_logged_in] (Ethernet version only) Held high when tcp-ip client is connected and the module has successfully logged in to the DVR[dvr_tcpip_not_logged_in](Ethernet version only) Held high when the module did not successfully log in to the DVRSerial Outputsdvr_tx$Connect to the tx$ line of the tcp-ip client or serial comm portParameters (Ethernet Version Only)ID Enter the ID of the DVR you want to control. Valid entries are contained in a drop-down listusername Enter the username of the account to use to log in to the DVR password Enter the password of the account to use to log in to the DVRtcp portThis parameter has only one valid value and is used for SystemBuilder supportContacting Technical SupportWirepath™ Surveillance DVR SupportPhone: (866) 838-5052 Email:**********************Crestron Module and Programming SupportContact Crestron for all support relating the use of these modules within Crestron programming software.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Java OWAPI OWAPI OWAPI OWAPI OWAPI
图 2. API 功能集
会话
分时使用 1-Wire 总线。这对于操作系统或几个进程或线程尝试同时使用同一总线的情况下是非常重要 的。当多项操作在同一器件上运行而又不能被打断的时候,需要独占总线的使用权。
链路
基本的 1-Wire 总线通信功能。 所有的 1-Wire 总线通信功能可以归结为:复位所有的器件和读写位。这 也包括设置总线电特性的功能,如提供专用的 EPROM 编程脉冲或进行供电。
是 执行其它 操作吗?
否 会话 释放 1-Wire 的独占式使用权
其它 处理申请表中的其它任务
AN155
iButton通信实质上是通过与其触头相接触来实现的。这意味着与器件的联系有时是不可靠的。iButton也可 能被安装到阅读器里,在阅读的时候弹出,从而必须有一个相容的纠错方法紧跟其后。当检测到虚假错误 时必须重发数据并在数据通信中进行CRC校验。API中的文件输入输出功能所利用的标准文件结构在 应用 笔记 114 (English only) 1-Wire File Structure中进行了详细说明。这种结构在每页数据上都使用CRC16, 以快速地校验所读数据的正确性。大多数 1-Wire API功能很少或者不能自动重发。重发受应用软件控制。 应用笔记 159 (English only)绝对可靠的 1-Wire通信 讲述了纠错方法和 1-Wire通信的风险评估。
图 3 概括了使用这些功能的典型顺序。‘会话’功能围绕着调用器件进行通信,具有代表性的是先使用一 个‘网络’功能,然后运行存储器或‘器件’的特定操作。
3
10/11/05
图 3. API 用法流程
会话 获取 1-Wire 的独占式使用权
网络 查找和/或者选定一个 1-Wire 器件
传输/存档/器件 选择做存储器还是器件的特定操作
API 的选择
本文主要列举了五种不同的应用程序接口(API)。这些 API 运行在不同的工作平台上,使用不同的语言, 具有不同的性能。表 2 简要地描述了这五种 API;表 3 说明了按语言划分的可利用 API 及其操作系统。
4
10/11/05
表 2. API 概述 API 1-Wire 公共文件资源
网络
查找和选择器件的网络功能。 每个 1-Wire 器件都有一个固定的序列号,作为它的唯一的网络地址。这 些功能可以通过链路层功能进行构造。在 1-Wire 器件数据资料中将其称为 ROM 指令,这是因为序列号 是只读的。还有一些 1-Wire 控制器包括一些内置功能,因为它们比通过链路功能进行构造有效得多。
传输
块通信和基本的存储器读/写功能。 这还包括存储器信息包读/写功能。这些功能是通过网络层和链路层 功能构造的。
文件
使用 1-Wire文件结构 (参考应用笔记 114,English only)的文档存储层功能。这些功能是通过网络层和 传输层功能构造的,且只对使用多页存储器的器件有效。
器件
专用器件的‘高层’功能。这些功能通常是通过网络、传输和链路类功能构造的,并执行诸如读取温度 值或设置开关状态等操作。
Thermochron 是 Dallas Semiconductor 的注册商标, Hygrochron 是 Dallas Semiconductor 的商标。 Java 是 Sun Microsystems 的商标。
2
10/11/05
AN155
API 基础
1-Wire 通信器件的不同应用程序接口 (API)有着许多共性,反映了协议的基本数据通信原理。图 2 是根据 不同 API 功能进行的分类。因为大多数 1-Wire 器件具有存储器,尽管存储器输入输出功能并不适用于所 有的器件,我们还是把它们视为一个通用 API 集。其它所有不具备存储器专用功能的划分为一类——专用 器件集。
TINI*
TMEX/OWCOM/ TMEX/OWCOM/ TMEX/OWCOM/ TMEX/OWCOM/ TMEX
()
PD PD PD PD PD PD PD PD PD PD PD
PD - 无 TINI 操作系统
( ) - 计划支持但尚未实现 *TINI® 是由Dallas Semiconductor研制的基于 Java操作系统的内置平台。
基于 Java 的 1-Wire API 基于.NET 1-Wire API 1-Wire COM
TMEX API
缩写 PD
OWAPI OWCOM TMEX
AN155
说明
源代码完全开放的C语言公共文件资源API,设计用于在多种PC操 作系统、手持设备操作系统和微控制器平台之间移植。对于PC平 台,通过本地驱动程序库在 32 位Microsoft Windows® 系统上支持 所有的 1-Wire适配器 (主机);利用跨平台库来支持其它PC操作系 统上的特定 1-Wire 适配器(DS9097U串行适配器和DS9490 USB 适 配器) 。 完全公开的、高级 Java API,支持几乎所有的 1-Wire 器件。除了 支持本地 1-Wire 主机外,它还可通过跨平台库来支持 DS9097U 串 行适配器和 DS9490 USB 适配器。 OWAPI 代 码 基 于 Microsoft 的 .NET 框 架 下 的 J# 。 对 于 紧 凑 型.NET 框架 (用于 Windows CE 机器),低级 1-Wire 链路层被转成 C#,可提供下载。 Windows 组件对象模型 (COM),OWAPI 的外壳,可以从标注语言 和诸如 Java 和 Visual Basic 的脚本语言中获得。注: OWCOM 依 赖于装有 Microsoft Java 虚拟机(MSJVM)、且 MSJVM 正常运行的 系统。Microsoft 不再支持 MSJVM。 在 32 位 Windows 平台上支持所有的 1-Wire 主适配器。提供链接 和文件输入输出功能,但不包括访问器件的功能。驱动程序是不公 开的资源。这种 API 可以被其它的 API 调用来访问所有类型的 1Wire 适配器。
1
10/11/05
表 1. 家族代码对照
家族代码
器件型号( ) – iButton封装
说明 (除非指明,否则存储器单位为位)
AN155
01 (十六进制)
(DS1990A), (DS1990R), DS2401, DS2411
只做 1-Wire 网络地址 (序列号)
02
(DS1991), DS1425
8 通道可编址开关
2C
DS2890
单路数字电位计
2D
DS2431
1024 位,1-Wire EEPROM
30
DS2760
温度传感器,电流,ADC
33
(DS1961S), DS2432
带 SHA-1 引擎的 1k EEPROM 存储器
37
(DS1977)
口令保护的 32kB (字节) EEPROM
3A
一旦一个器件被用于总线通信,主机就能向它发出特定的器件指令,对它进行数据读写。这是因为每类器 件具有不同的功能和不同的用途,而且一旦器件被选定,就有了唯一的协议。虽然每类器件具有不同的协 议和特征,但其工作过程却是相同的并且遵循如图 1 所示的工作流程。
图 1. 典型的 1-Wire 通信流程
复位 1-Wire 总线
1C
DS28E04-100
1D
DS2423
4096位 EEPROM 存储器,2路可编址开关 具有外部计数器的 4kb NV RAM 存储器
1F
DS2409
用于子网的 2 路可编址耦合器
20
DS2450
4 通道 A/D 转换器 (ADC)
21
(DS1921), (DS1921H), (DS1921Z)
12
DS2406, DS2407
1kb EPROM 存储器, 2 路可编址开关
14
(DS1971), DS2430A
256 位 EEPROM 存储器和 64 位 OTP 寄存器
18
(DS1963S)
4kb NV RAM 存储器和 SHA-1 引擎
1A
(DS1963L)
具有写周期计数器的 4kb NV RAM 存储器
(DS2413)
双通道可编址开关
41
(DS1922L), (DS1922T), (DS1923), DS2422
高存储容量 Thermochron (温度)和 Hygrochron™ (湿度) 记录器
*该列表中并非 Dallas 的全部 1-Wire 器件 (家族),这些仅是 Automatic Information 事业部提供的软件库可直接支持的器件。
所有通信的第一步都需要总线控制器发出一个‘复位’信号以使总线同步,然后选择一个受控器件进行随 后的通信,这可以通过选择所有的受控器件或者选择一个特定的受控器件 (利用该器件的序列号进行选择) 或者通过对半检索法找到总线上的下一个受控器件来实现。上文所提到的这些指令都是‘网络’指令或者 只读存储器 (ROM)指令。一旦一个特定的器件被选中,那么在下次复位信号发出之前,所有其它器件都被 挂起而忽略随后的通信。
多键iButton,1152 位安全存储器
04
(DS1994), DS2404
4kb NV RAM 存储器和时钟,定时器,报警
05
DS2405
单一的可寻址开关
Байду номын сангаас06
(DS1993)
4kb NV RAM 存储器
08
(DS1992)
1kb NV RAM 存储器
09
(DS1982), DS2502
1kb EPROM 存储器
Thermochron® 温度记录器