要約
各1-Wire®デバイスにレーザ書込みされたリードオンリーメモリ(ROM)番号に埋め込まれている「ファミリコード」は、特定のデバイスタイプを表しています。各デバイスタイプは、異なる機能とコマンドを備えているため、1-Wireマスターは、この「ファミリコード」を正しいコマンドに変換する方法を知ることが必須となります。このアプリケーションノートでは、1-Wireマスターを動的に構成して、1-WireマスターにXML構成ファイルを提供することによって、これまで未知であった1-Wireデバイスタイプと正しく通信する方法を示しています。このアプリケーションノートは、元は、IEEE® 1451.4 A Smart Transducer Interface for Sensors and Actuators—Mixed-Mode Communication Protocols and Transducer Electronic Data Sheet (TEDS) Formats標準化委員会をサポートするために作成されたものです。
はじめに
コマンドの表記
表1. 1-Wireのコアコマンド | |
表記 | コマンドの説明 |
XX | 次の16進バイトの値を1-Wireバスに送る。この16進バイトが巡回冗長検査(CRC)ブロック内である場合は、1-Wire動作の結果に基づいてCRCを計算する(検証コマンド参照)。 |
{L, delay} | 「L」ミリ秒の遅延 |
{M} | 1-Wireリセット、Match ROMコマンド、およびデバイスROMでデバイスを選択 |
{P} | 1-Wire電力供給(ストロングプルアップ)を準備、または次の1-Wireバイト後に発生 |
{N} | 通常のプルアップに復帰させる |
{U} | 12ボルトのパルスを発行(消去可能プログラマブルリードオンリーメモリ) EPROMのプログラミングで使用) |
{Ax} | メモリアドレスを提供し、「x」は最下位バイト(LSB)~最上位バイト(MSB)を表す数字の0、1…。例えば、「{A0}{A1}」は最下位バイトが先で最上位バイトが続く16ビットアドレスを特定。 |
{Dx} | メモリデバイスに書き込むデータで、「x」はデータのLSB~MSBを表す数字の0、1…。例えば、「{D0}{D1}{D2}」は書き込みデータの3バイト。これらのコマンドを処理するマスターはコマンドフローに実際のデータを配置することに注意してください。 |
{R} | メモリバイトをメモリの最後まで読み込む。すべての読み込まれた値は有効なデータですが、検証が行われます。 |
表2. 検証コマンド | |
表記 | コマンドの説明 |
{dx} | 読み込むデータ。このデータは、メモリ1-Wireデバイスに書き込まれるデータの検証、または温度変換などの結果データである場合があります。{Dx}コマンドと同じフォーマットで、「x」は{d0}を持つバイト数がLSBを意味する数であることに注意してください。 |
{T} | 0xAAまたは0x55などのトグリングビットの読込みに成功 |
{00} | 0x00などすべてのビットが0の読込みに成功 |
{FF} | 0xFFなどすべてのビットが1の読込みに成功 |
{CRC16,start,seed} | まずCRC16を16進表記で表される提供済みの「シード」に設定し、CRC16の計算を開始。続くすべてのコマンドバイトは、「チェック」コマンドが見つかるまでこの計算に含む。 |
{CRC16,check,value} | 計算されたCRC16の値が、提供済みの16進の「値」に等しいことを確認。等しくない場合は失敗。この確認後にCRC16の計算は停止できます。 |
{CRC8,start,seed} | まずCRC8を16進表記で表される提供済みの「シード」に設定し、CRC8の計算を開始。続くすべてのコマンドバイトは、「チェック」コマンドが見つかるまでこの計算に含む。 |
{CRC16,check,value} | 計算されたCRC8の値が、提供済みの16進の「値」に等しいことを確認。等しくない場合は失敗。この確認後にCRC8の計算は停止できます。 |

図1. DS18B20の温度読取りコマンドシーケンスと1-Wireマスター変換
デバイスタイプ
メモリデバイスには、ある種のデータ記憶メモリ領域があります。これは追記型でかまいませんが、複数の読取りをサポートする必要があります。データ記憶メモリ領域はほとんどの場合、ページ単位で配置されており、通常、一度に1ページを書き込みます。メモリデバイスは、属性の異なる複数バンクのメモリであってもかまいません。
表3. デバイスの動作と属性(タイプ別) | ||
Device Type | Operations | Attributes |
Memory | Read Write |
Read/Write/ReadOnly/WriteOnce Starting Physical Address Number of Pages Page Length in Bytes |
Switch | Read Latch Enable Latch Disable Latch Read Level (optional) |
High Side/Low Side |
Temperature | Read | Min Temperature Max Temperature Step (unit of Celsius returned from Read) |
構成フォーマット
例
<?xml version="1.0" encoding="UTF-8"?> <!-- The device description file follows the schema defined in ??? and defines devices DS2433, DS2430, DS2406,DS2409,DS18S20,DS1920 and DS18B20.--> <DeviceDescriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="\Device Schema\Device Schema.xsd"> <DeviceDescriptions> <Device FamilyCode="0x23"> <Description> DS2433, 4kbit EEPROM </Description> <MemoryBank attributes="ReadWrite"> <Description> Main Memory </Description> <StartAddress> 0x0000 </StartAddress> <Pages> 16 </Pages> <PageLength> 32 </PageLength> <Write> <WriteScratchPad> {M} {CRC16,start,0} 0F {A0} {A1} {D0} {D1} {D2} {D3} {D4} {D5} {D6} {D7} {D8} {D9} {D10} {D11} {D12} {D13} {D14} {D15} {D16} {D17} {D18} {D19} {D20} {D21} {D22} {D23} {D24} {D25} {D26} {D27} {D28} {D29} {D30} {D31} FF FF {CRC16,check,0xB001} </WriteScratchPad> <CopyScratchPad> {M} 55 {A0} {A1} {P} 1F {L,10} {N} {T} </CopyScratchPad> </Write> <Read> <ReadMemory> {M} F0 {A0} {A1} {R} </ReadMemory> </Read> </MemoryBank> </Device> <Device FamilyCode="0x14"> <Description> DS2430A, 32-byte EEPROM with locking register </Description> <MemoryBank attributes="ReadWrite"> <Description> Main Memory </Description> <StartAddress> 0x0000 </StartAddress> <Pages> 1 </Pages> <PageLength> 32 </PageLength> <Write> <WriteScratchPad> {M} 0F {A0} {D0} {D1} {D2} {D3} {D4} {D5} {D6} {D7} {D8} {D9} {D10} {D11} {D12} {D13} {D14} {D15} {D16} {D17} {D18} {D19} {D20} {D21} {D22} {D23} {D24} {D25} {D26} {D27} {D28} {D29} {D30} {D31} </WriteScratchPad> <ReadScratchPad> {M} AA {A0} {d0} {d1} {d2} {d3} {d4} {d5} {d6} {d7} {d8} {d9} {d10} {d11} {d12} {d13} {d14} {d15} {d16} {d17} {d18} {d19} {d20} {d21} {d22} {d23} {d24} {d25} {d26} {d27} {d28} {d29} {d30} {d31} </ReadScratchPad> <CopyScratchPad> {M} 55 {P} A5 {L,20} {N} </CopyScratchPad> </Write> <Read> <ReadMemory> {M} F0 {A0} {R} </ReadMemory> </Read> </MemoryBank> <MemoryBank attributes="WriteOnce"> <Description> Application Register </Description> <StartAddress> 0x0000 </StartAddress> <Pages> 1 </Pages> <PageLength> 8 </PageLength> <Write> <WriteAppReg> {M} 99 {A0} {D0} {D1} {D2} {D3} {D4} {D5} {D6} {D7} </WriteAppReg> <ReadAppReg> {M} C3 {A0} {d0} {d1} {d2} {d3} {d4} {d5} {d6} {d7} </ReadAppReg> <CopyAndLock> {M} 5A {P} A5 {L,20} {N} </CopyAndLock> </Write> <Read> <ReadAppReg> {M} C3 {A0} {R} </ReadAppReg> </Read> </MemoryBank> </Device> <Device FamilyCode="0x12"> <Description> DS2406, dual channel switch with 1kbit EPROM </Description> <MemoryBank attributes="WriteOnce"> <Description> Main Memory </Description> <StartAddress> 0x0000 </StartAddress> <Pages> 4 </Pages> <PageLength> 32 </PageLength> <Write> <WriteScratchPad> {M} {CRC16,start,0} 0F {A0} {A1} {D0} FF FF {CRC16,check,0xB001} </WriteScratchPad> <Program> {U} </Program> <ReadVerify> {d0} </ReadVerify> </Write> <Read> <ReadMemory> {M} F0 {A0} {A1} {R} </ReadMemory> </Read> </MemoryBank> <SwitchChannel attributes="LowSide"> <Description> PIO-A </Description> <ReadLatch AndMask="0x01" Polarity="0x00"> {M} {CRC16,start,0} F5 55 FF {d0} FF FF {CRC16,check,0xB001} </ReadLatch> <ReadLevel AndMask="0x04" Polarity="0x04"> {M} {CRC16,start,0} F5 55 FF {d0} FF FF {CRC16,check,0xB001} </ReadLevel> <EnableLatch> {M} {CRC16,start,0} F5 05 FF 00 FF FF {CRC16,check,0xB001} </EnableLatch> <DisableLatch> {M} {CRC16,start,0} F5 05 FF FF FF FF {CRC16,check,0xB001} </DisableLatch> </SwitchChannel> <SwitchChannel attributes="LowSide"> <Description> PIO-B </Description> <ReadLatch AndMask="0x02" Polarity="0x00"> {M} {CRC16,start,0} F5 55 FF {d0} FF FF {CRC16,check,0xB001} </ReadLatch> <ReadLevel AndMask="0x08" Polarity="0x08"> {M} {CRC16,start,0} F5 55 FF {d0} FF FF {CRC16,check,0xB001} </ReadLevel> <EnableLatch> {M} {CRC16,start,0} F5 09 FF 00 FF FF {CRC16,check,0xB001} </EnableLatch> <DisableLatch> {M} {CRC16,start,0} F5 09 FF FF FF FF {CRC16,check,0xB001} </DisableLatch> </SwitchChannel> </Device> <Device FamilyCode="0x1F"> <Description> DS2409, 1-Wire Coupler </Description> <SwitchChannel attributes="HighSide"> <Description> Main </Description> <ReadLatch AndMask="0x01" Polarity="0x00"> {M} 5A 18 {d0} </ReadLatch> <ReadLevel AndMask="0x02" Polarity="0x02"> {M} 5A 18 {d0} </ReadLevel> <ReadActivity AndMask="0x10" Polarity="0x10"> {M} 5A 18 {d0} </ReadActivity> <EnableLatch> {M} A5 FF </EnableLatch> <DisableLatch> {M} 66 FF </DisableLatch> </SwitchChannel> <SwitchChannel attributes="HighSide"> <Description> Auxilary </Description> <ReadLatch AndMask="0x04" Polarity="0x00"> {M} 5A 18 {d0} </ReadLatch> <ReadLevel AndMask="0x08" Polarity="0x08"> {M} 5A 18 {d0} </ReadLevel> <EnableLatch> {M} 33 FF FF FF </EnableLatch> <DisableLatch> {M} 66 FF </DisableLatch> </SwitchChannel> </Device> <Device FamilyCode="0x10"> <Description> DS18S20/DS1920, fixed resolution temperature </Description> <TemperatureChannel min="-55" max="125" step="0.5"> <Read> <Recall> {M} B8 </Recall> <Conversion> {M} {P} 44 {L,750} {N} {FF} </Conversion> <Result> {M} BE {CRC8,start,0} {d0} {d1} FF FF FF FF FF FF FF {CRC8,check,0x00} </Result> </Read> </TemperatureChannel> </Device> <Device FamilyCode="0x28"> <Description> DS18B20, high-resolution temperature </Description> <TemperatureChannel min="-55" max="125" step="0.0625"> <Setup> <WriteScatchPad> {M} 00 00 7F </WriteScatchPad> <CopyScatchPad> {M} {P} 48 {L,10} {N} </CopyScatchPad> </Setup> <Read> <Recall> {M} B8 </Recall> <Conversion> {M} {P} 44 {L,750} {N} {FF} </Conversion> <Result> {M} BE {CRC8,start,0} {d0} {d1} FF FF FF FF FF FF FF {CRC8,check,0x00} </Result> </Read> </TemperatureChannel> </Device></DeviceDescriptions>
<?xml version="1.0" encoding="UTF-8"?> <!-- The IEEE 1451.4 XML device description schema provides a template for manufacturers and users of the IEEE14514 to add support for new devices to their systems. The schema defines devices that support memory, switching and temperature reading. --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="Conversion" type="xs:string"/> <xs:element name="CopyAndLock" type="xs:string"/> <xs:element name="CopyScatchPad" type="xs:string"/> <xs:element name="CopyScratchPad" type="xs:string"/> <xs:element name="Description" type="xs:string"/> <xs:complexType name="IEEE1451_Dot4DeviceType"> <xs:sequence> <xs:element ref="Description"/> <xs:element name="MemoryBank" type="MemoryBankType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="SwitchChannel" type="SwitchChannelType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="TemperatureChannel" type="TemperatureChannelType" minOccurs="0"/> </xs:sequence> <xs:attribute name="FamilyCode" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="0x10"/> <xs:enumeration value="0x12"/> <xs:enumeration value="0x14"/> <xs:enumeration value="0x1F"/> <xs:enumeration value="0x23"/> <xs:enumeration value="0x28"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:element name="DeviceDescriptions"> <xs:complexType> <xs:sequence> <xs:element name="Device" type="IEEE1451_Dot4DeviceType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="DisableLatch" type="xs:string"/> <xs:element name="EnableLatch" type="xs:string"/> <xs:complexType name="MemoryBankType"> <xs:sequence> <xs:element ref="Description"/> <xs:element ref="StartAddress"/> <xs:element ref="Pages"/> <xs:element ref="PageLength"/> <xs:element name="Write" type="WriteType"/> <xs:element name="Read" type="ReadType"/> <xs:element name="CRCInformation" minOccurs="0"> <xs:complexType> <xs:sequence maxOccurs="unbounded"> <xs:element name="CRCStartBitPageLocation" type="xs:unsignedLong"/> <xs:element name="CRCBitLength" type="xs:unsignedLong"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="attributes" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="ReadWrite"/> <xs:enumeration value="WriteOnce"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:element name="PageLength" type="xs:unsignedLong"/> <xs:element name="Pages" type="xs:unsignedLong"/> <xs:element name="Program" type="xs:string"/> <xs:complexType name="ReadType"> <xs:sequence> <xs:element ref="ReadMemory" minOccurs="0"/> <xs:element ref="ReadAppReg" minOccurs="0"/> <xs:element ref="Recall" minOccurs="0"/> <xs:element ref="Conversion" minOccurs="0"/> <xs:element ref="Result" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="ReadActivityType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="AndMask" type="xs:string" use="required"/> <xs:attribute name="Polarity" type="xs:string" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="ReadAppReg" type="xs:string"/> <xs:complexType name="ReadLatchType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="AndMask" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="0x01"/> <xs:enumeration value="0x02"/> <xs:enumeration value="0x04"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="Polarity" type="xs:decimal" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="ReadLevelType"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="AndMask" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="0x02"/> <xs:enumeration value="0x04"/> <xs:enumeration value="0x08"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="Polarity" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="0x02"/> <xs:enumeration value="0x04"/> <xs:enumeration value="0x08"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="ReadMemory" type="xs:string"/> <xs:element name="ReadScratchPad" type="xs:string"/> <xs:element name="ReadVerify" type="xs:string"/> <xs:element name="Recall" type="xs:string"/> <xs:element name="Result" type="xs:string"/> <xs:complexType name="SetupType"> <xs:sequence> <xs:element ref="WriteScatchPad"/> <xs:element ref="CopyScatchPad"/> </xs:sequence> </xs:complexType> <xs:element name="StartAddress" type="xs:string"/> <xs:complexType name="SwitchChannelType"> <xs:sequence> <xs:element ref="Description"/> <xs:element name="ReadLatch" type="ReadLatchType"/> <xs:element name="ReadLevel" type="ReadLevelType"/> <xs:element name="ReadActivity" type="ReadActivityType" minOccurs="0"/> <xs:element ref="EnableLatch"/> <xs:element ref="DisableLatch"/> </xs:sequence> <xs:attribute name="attributes" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="HighSide"/> <xs:enumeration value="LowSide"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="TemperatureChannelType"> <xs:sequence> <xs:element name="Setup" type="SetupType" minOccurs="0"/> <xs:element name="Read" type="ReadType"/> </xs:sequence> <xs:attribute name="min" type="xs:byte" use="required"/> <xs:attribute name="max" type="xs:byte" use="required"/> <xs:attribute name="step" use="required"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="0.0625"/> <xs:enumeration value="0.5"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="WriteType"> <xs:sequence> <xs:element ref="WriteScratchPad" minOccurs="0"/> <xs:element ref="ReadScratchPad" minOccurs="0"/> <xs:element ref="CopyScratchPad" minOccurs="0"/> <xs:element ref="WriteAppReg" minOccurs="0"/> <xs:element ref="ReadAppReg" minOccurs="0"/> <xs:element ref="CopyAndLock" minOccurs="0"/> <xs:element ref="Program" minOccurs="0"/> <xs:element ref="ReadVerify" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:element name="WriteAppReg" type="xs:string"/> <xs:element name="WriteScatchPad" type="xs:string"/> <xs:element name="WriteScratchPad" type="xs:string"/> </xs:schema>
付録
メモリ構成ページ
表A1. 構成ページのフォーマット | |||
Byte Offset | Name | Content | |
0 | Length | Length of data in the configuration page (fixed at 26) | |
1 | General_Flags | Bit 0 | Memory type (1 EEPROM, 0 EEPROM) |
Bit 1 | Scratchpad erased on read-memory (1 YES, 0 NO) | ||
Bit 2 | Device has read page with CRC16 (1 YES, 0 NO) | ||
Bit 3 | Device has write-once mode like pseudo EPROM (1 YES, 0 NO) (EEPROM only) | ||
Bit 4 | Device has map of used pages (1 YES, 0 NO) | ||
Bit 5 | Not used 0 | ||
Bit 6 | Not used 0 | ||
Bit 7 | Not used 0 | ||
2 | WriteProt_Flags | Bit 0 | Individual page write-protect (1 YES, 0 NO) |
Bit 1 | Global device write-protect (1 YES, 0 NO) | ||
Bit 2 | Write protect register is organized with one page per bit (1 YES, 0 NO). If not then one page per byte | ||
Bit 3 | Not used 0 | ||
Bit 4 | Not used 0 | ||
Bit 5 | Not used 0 | ||
Bit 6 | Not used 0 | ||
Bit 7 | Not used 0 | ||
3 | CRC_Flags | Bit 0 | Write scratchpad has CRC16 (1 YES, 0 NO) |
Bit 1 | Read scratchpad has CRC16 (1 YES, 0 NO) | ||
Bit 2 | Read special memory command has CRC16 (1 YES, 0 NO) | ||
Bit 3 | Not used 0 | ||
Bit 4 | Not used 0 | ||
Bit 5 | Not used 0 | ||
Bit 6 | Not used 0 | ||
Bit 7 | Not used 0 | ||
4 | Scratchpad_Length | Length of scratchpad in bytes (EEPROM only) | |
5 | Page_Length | Length of normal memory page in bytes | |
6 | Pages | Number of pages (2 bytes) | |
8 | Special_Pages | Number of special function pages | |
9 | Special_Page_Length | Length of special memory page in bytes | |
10 | ReadScratch_CMD | Read scratchpad command | |
11 | Write_CMD | Write command (scratchpad for EEPROM) | |
12 | CopyScratch_CMD | Copy scratchpad command | |
13 | ReadPageCRC_CMC | Read page of memory with CRC16 command | |
14 | ReadSpecial_CMD | Read special memory page command | |
15 | Write_Special_CMD | Write special memory command | |
16 | WriteProt_Addr | Address of write-protect registers in special memory (2 bytes) | |
18 | WriteProtDev_Addr | Address of write-protect entire device register in special memory (2 bytes) | |
20 | WriteOnce_Addr | Address to write-once mode (pseudo EPROM) flag in special memory (2 bytes) | |
22 | UsedPgs_Addr | Address in special memory for map of used pages (2 bytes) | |
24 | UsedPgs_Offset | Bit offset of the map of used pages | |
25 | WriteProt_Value | Value written to special memory register to write-protect a page | |
26 | WriteOnce_Value | Value written to special memory register to make a page write-once like pseudo EPROM | |
27 | CRC16 | Bitwise inverted CRC16 of bytes 0 to 24, LSB first (2 bytes) |
表A2. 操作 | |||
Operation | EEPROM | EPROM | Description |
Read Memory | X | X | Read memory with device-generated CRC |
Read Page with CRC | x | x | Read a page of memory with device-generated CRC |
Write Scratchpad | X | Write the scratchpad in preparation of writing to memory | |
Read Scratchpad | X | Read the scratchpad to verify the write was correct | |
Copy Scratchpad | X | Copy the scratchpad to the final memory location | |
Write Memory | X | Write a byte to memory | |
Read Speical Page with CRC | x | Read a page of special memory with device-generated CRC | |
Write Special Byte | x | Write a byte to the special memory | |
Write Protect Page | x | x | Write-protect a page |
Set Page for Write-Once | x | Set an EEPROM page to be write-once like (pseudo EPROM) | |
Calculate Free Pages | x | Calculate the number of free pages in an EPROM device by looking at the map of used pages. |
x:このタイプの一部のデバイスでサポートされる
<空白>:通常、このタイプのデバイスではサポートされない
詳細な操作
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- ReadMemoryコマンド(F0 hex)の書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- データの読取り
- General_Flags.Bit2 = 1の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- ReadPageCRC_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- Page_Lengthバイトの読取り(アドレスがページの先頭にない場合を除く)
- ビット単位で反転CRC16の読取り
- General_Flags.Bit0 = 1の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- Write_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- データバイトの書込み
- CRCFlags.Bit0 = 1の場合およびページの最後で
- ビット単位で反転CRC16の読取り
スクラッチパッドの読取り- General_Flags.Bit0 = 1の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- ReadScratch_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の読取り
- 第2アドレスバイトTA2 (MSB)の読取り
- オフセットとステータスフラグESの読取り
- データバイトの読取り
- CRCFlags.Bit1 = 1の場合およびページの最後で
- ビット単位で反転CRC16の読取り
スクラッチパッドのコピー- General_Flags.Bit0 = 1の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- CopyScratch_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- オフセットとステータスフラグESの書込み
- 最小10msの間、ストロングプルアップを1-Wireに適用
- 確認バイトの読取り(AAまたは55であること)
メモリの書込み- General_Flags.Bit0 = 0の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- Write_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- 書き込むべきデータバイトの書込み
- コマンド、アドレス、およびデータ(第1パス)、またはアドレスおよびデータ(第2パス)の反転CRC16のビット単位の読取り
- 1-Wire上に480µsで12Vのプログラミングパルスを印加
- 確認データバイトの読取り(古いデータバイトと最新データバイトのORが必要)
- 書き込むべき次のアドレスが連続アドレスであれば、次のデータバイトを送信することができます...
CRC付きの特殊ページの読取り- General_Flags.Bit2 = 1の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- ReadSpecial_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の読取り
- 第2アドレスバイトTA2 (MSB)の読取り
- Special_Page_Lengthバイトの読取り(アドレスがページの先頭にない場合を除く)
- ビット単位で反転CRC16の読取り
特殊バイトの書込み- General_Flags.Bit0 = 0の場合
- 1-Wireリセットとプレゼンス
- ROMレベルのコマンドシーケンス(read/search/match/overdrive match/overdrive skip)
- Write_Special_CMDの書込み
- 第1アドレスバイトTA1 (LSB)の書込み
- 第2アドレスバイトTA2 (MSB)の書込み
- 書き込むべきデータバイトの書込み
- コマンド、アドレス、およびデータ(第1パス)、またはアドレスおよびデータ(第2パス)の反転CRC16のビット単位の読取り
- 1-Wire上に480µsで12Vのプログラミングパルスを印加
- 確認データバイトの読取り(古いデータバイトと最新データバイトのORが必要)
- 書き込むべき次のアドレスが連続アドレスであれば、次のデータバイトを送信することができます...
保護ページの書込み- WriteProt_Flags.Bit0 = 1の場合
- WriteProt_Flags.Bit2 = 1の場合
- Address = WriteProt_Addr + Page/8
- Data = WriteProt_Value Rotate left Remainder (Page/8)
- Else
- Address = WriteProt_Addr + Page
- Data = WriteProt_Value
- AddressとDataを用いた特殊バイトの書込み
- WriteProt_Flags.Bit2 = 1の場合
追記型ページの設定- General_Flags.Bit3 = 1の場合
- Address = WriteOnce_Addr
- Data = WriteOnce_Value
- AddressとDataを用いた特殊バイトの書込み
使用済みページにマーク- General_Flags.Bit4 = 1の場合
- Address = UsedPgs_Addr + (Page + UsedPgs_Offset)/8
- Data = BitInverse (1 Rotate left Remainder ((Page + UsedPgs_Offest)/8)
- AddressとDataにて特殊バイトの書込み
フリーページの計算- General_Flags.Bit4 = 1の場合
- Address = UsedPgs_Addr
- Addressから始まり、(Special_Pages/8)の読取りバイトまでのCRC付き特殊ページの読取り
- 読取りバイト内の1の数をカウント(これがフリーページの数になる)
表A3は、テンプレートとして既存のデバイスを使用した構成ページの例を示しています。ただし、現在、これらのデバイスには構成ページは含まれていません。表A3. 構成ページの例 No. # Name Content DS2433 DS2406 DS2505 DS2506 DS2431 DS28E04 0 Length Length of data in the configuration page 1A 1A 1A 1A 1A 1A 1 General_Flags Bit 0 Memory type (1 EEPROM, 0 EPROM) 1 0 0 0 1 1 Bit 1 Scratchpad erased on read memory (1 YES, 0 NO) 1 0 0 0 1 1 Bit 2 Device has read page with CRC16 (1 YES, 0 NO) 0 1 1 1 1 1 Bit 3 Device has write-once mode like pseudo EPROM (1 YES, 0 NO) (EEPROM only) 0 0 0 0 1 1 Bit 4 Device has map of used pages (1 YES, 0 NO) 0 1 1 1 0 0 Bit 5 Not used 0 0 0 0 0 0 Bit 6 Not used 0 0 0 0 0 0 Bit 7 Not used 0 0 0 0 0 0 2 WriteProt_Flags Bit 0 Individual page write-protect (1 YES, 0 NO) 0 1 1 1 1 1 Bit 1 Global device write-protect (1 YES, 0 NO) 0 0 0 0 0 0 Bit 2 Write-protect register is organized with one page per bit (1 YES, 0 NO). If no then is one page per byte. 0 1 1 1 0 0 Bit 3 Not used 0 0 0 0 0 0 Bit 4 Not used 0 0 0 0 0 0 Bit 5 Not used 0 0 0 0 0 0 Bit 6 Not used 0 0 0 0 0 0 Bit 7 Not used 0 0 0 0 0 0 3 CRC_Flags Bit 0 Write scratchpad has CRC16 (1 YES, 0 NO) 1 0 0 0 1 1 Bit 1 Read scratchpad has CRC16 (1 YES, 0 NO) 0 0 0 0 1 1 Bit 2 Read special memory command has CRC16 (1 YES, 0 NO) 0 1 1 1 0 0 Bit 3 Not used 0 0 0 0 0 0 Bit 4 Not used 0 0 0 0 0 0 Bit 5 Not used 0 0 0 0 0 0 Bit 6 Not used 0 0 0 0 0 0 Bit 7 Not used 0 0 0 0 0 0 4 Scratchpad_Length Length of scratchpad in bytes (EEPROM only) 20 00 00 00 08 20 5 Page_Length Length of normal memory page in bytes 20 20 20 20 20 20 6 Pages Number of pages 10
0004
0040
0000
0104
0010
008 Special_Pages Number of special function pages 00 01 0B 0B 01 02 9 Special_Page_Length Length of special memory page in bytes 00 08 08 08 08 20 10 ReadScratch_CMD Read scratchpad command AA 00 00 00 AA AA 11 Write_CMD Write command (scratchpad for EEPROM) 0F 0F 0F 0F 0F 0F 12 CopyScratch_CMD Copy scratchpad command 55 00 00 00 55 55 13 ReadPageCRC_CMD Read page of memory with CRC16 command 00 A5 A5 A5 00 00 14 ReadSpecial_CMD Read special memory page command 00 AA AA AA F0 F0 15 Write_Special_CMD Write special memory command 00 55 55 55 0F 0F 16 WriteProt_Addr Address of write-protect registers in special memory (2 bytes) 00
0000
0000
0000
0080
0000
2018 WriteProtDev_Addr Address of write-protect entire device register in special memory (2 bytes) 00
0000
0000
0000
0000
0000
0020 WriteOnce_Addr Address to write-once mode (pseudo EPROM) flag in special memory (2 bytes) 00
0000
0000
0000
0080
0000
2022 UsedPgs_Addr Address in special memory for map of used pages (2 bytes) 00
0000
0040
0040
0000
0000
0024 UsedPgs_Offset Bit offset of the map of used pages 00 04 00 00 00 00 25 WriteProt_Value Value written to special memory register to write-protect a page 00 00 00 00 55 55 26 WriteOnce_Value Value written to special memory register to make a page write-once like pseudo EPROM 00 00 00 00 AA AA 27 CRC16 Bitwise inverted CRC16 of bytes 0 to 24, LSB first (2 bytes) xx
xxxx
xxxx
xxxx
xxxx
xxxx
xx
XXの2数字は16進数DS2506、DS2409、およびDS2430Aは、新規設計用には推奨されません。
この記事に関して
製品
MicroLANカプラ
1024ビット、1-Wire EEPROM
64Kbアドオンリーメモリ
エコノ1-Wireデジタルサーモメータ
1-Wire寄生電力デジタルサーモメータ
1-Wire寄生電力デジタルサーモメータ
寄生電源デジタルサーモメータ
1-Wire周囲温度センサー
1-Wire寄生電源、周囲温度センサー
プログラマブル分解能1-Wireデジタルサーモメータ
iButton温度ロガー
256ビット1-Wire EEPROM
1-Wire EEPROM
4Kb、1-Wire EEPROM
1Kbメモリ付き、デュアル、アドレス指定可能なスイッチ
PIO付き、4096ビットアドレス指定可能1-Wire EEPROM
16Kbアドオンリーメモリ
{{modalTitle}}
{{modalDescription}}
{{dropdownTitle}}
- {{defaultSelectedText}} {{#each projectNames}}
- {{name}} {{/each}} {{#if newProjectText}}
-
{{newProjectText}}
{{/if}}
{{newProjectTitle}}
{{projectNameErrorText}}