DS1921G DALLAS | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 45
Technical content
www.maxim-ic.com SPECIAL FEATURES Digital thermometer measures temperature in 0.5°C increments Accuracy ±1°C from -30°C to +70°C. See EC table for accuracy specification Built-in real-time clock (RTC) and timer has accuracy of ±2 minutes per month from 0°C to 45°C Water resistant or waterproof if placed inside DS9107 iButton® capsule (Exceeds Water Resistant 3 ATM requirements) Automatically wakes up and measures tem- perature at user-programmable intervals from 1 to 255 minutes Logs up to 2048 consecutive temperature measurements in protected nonvolatile (NV) random access memory Records a long-term temperature histogram with 2.0°C resolution Programmable temperature-high and temperature-low alarm trip points Records up to 24 time stamps and durations when temperature leaves the range specified by the trip points 512 bytes of general-purpose read/write NV random access memory Communicates to host with a single digital signal at 15.4kbits or 125kbits per second using 1-Wire ® protocol COMMON iButton FEATURES Digital identification and information by momentary contact Unique, factory-lasered and tested 64-bit reg- istration number (8-bit family code + 48-bit serial number + 8-bit CRC tester) assures ab- solute traceability because no two parts are alike Multidrop controller for 1-Wire net Chip-based data carrier compactly stores information Data can be accessed while affixed to object Button shape is self-aligning with cup-shaped probes Durable stainless-steel case engraved with registration number withstands harsh environments Easily affixed with self-stick adhesive backing, latched by its flange, or locked with a ring pressed onto its rim Presence detector acknowledges when reader first applies voltage Meets UL#913 (4th Edit.). Intrinsically Safe Apparatus: approved under Entity Concept for use in Class I, Division 1, Group A, B, C and D Locations F5 MICROCAN IO GND 0.51 5.89 16.25 17.3589 21 000000FBC52B 1-Wire Thermochron® All dimensions are shown in millimeters.
ORDERING INFORMATION
DS1921G-F5 -40° C to +85°C F5 i Button EXAMPLES OF ACCESSORIES DS9096P Self-Stick Adhesive Pad DS9101 Multi-Purpose Clip DS9093RA Mounting Lock Ring DS9093A Snap-In Fob DS9092 i Button Probe 1-Wire, Microcan, and iButton are registered trademarks of Dallas Semiconductor, Corp., a wholly owned subsidiary of Maxim Integrated Products, Inc.
DS1921G Thermochron iButton 2 of 45 iButton DESCRIPTION The DS1921G Thermochron i Button is a rugged, self-sufficient sy stem that measures temperature and records the result in a protected me mory section. The recording is done at a user-defined rate, both as a direct storage of temperature values as well as in the form of a histogram. Up to 2048 temperature values taken at equidistant intervals ranging from 1 to 255 minutes can be stored. The histogram provides 63 data bins with a resolution of 2.0°C. If the temp erature leaves a user-pr ogrammable range, the DS1921G will also record when this happened, for how long the temperature stayed outside the permitted range, and if the temperature was too high or too low. An additional 512 bytes of read/write NV memory allow storing information pertaining to the object to which the DS1921G is associated. Data is transferred serially via the 1-Wire protocol, which requires only a single data lead and a ground return. Every DS1921G is factory-lasered with a guaranteed unique electrically readable 64-bit registration number that allows for absolute traceability. The durable stainle ss steel package is highly resistant to environmental hazards such as dirt, moisture, and shock. Accessori es permit the DS1921G to be mounted on almost any object, including containers, pallets, and bags. APPLICATION The DS1921G Thermochron i Button is an ideal device to monitor the temperature of any object it is attached to or shipped with, such as perishable goods or containers of temperature sensitive chemicals. The read/write NV memory can store an electronic copy of shipping information, date of manufacture and other important data writt en as clear as well as encrypted files. Note that the initial sealing level of DS1921G achieves IP56. Aging and use c onditions can degrade the integrity of the seal over time, so for applications with significant exposure to liquids, sp rays, or other similar environments, it is recom- mended to place the Thermochron in the DS9107 i Button capsule. The DS9107 provides a watertight enclosure that has been rated to IP68 (see www.maxim-ic.com/AN4126). OVERVIEW The block diagram in Figure 1 shows the relationships between the major control and memory sections of the DS1921G. The device has seven main data compone nts: 1) 64-bit lasered ROM, 2) 256-bit scratch- pad, 3) 4096-bit general-purpose SRAM, 4) 256-bit regi ster page of timekeeping, control, and counter registers, 5) 96 bytes of alarm time stamp and du ration logging memory, 6) 126 bytes of histogram mem- ory, and 7) 2048 bytes of data-logg ing memory. Except for the ROM and the scratchpad, all other mem- ory is arranged in a single linear address space. All memory reserved for logging purposes, counter reg- isters and several other registers are read-only for the user. The timekeeping and control registers are write-protected while the device is programmed for a mission. The hierarchical structure of the 1- Wire protocol is shown in Figure 2. The bus master must first provide one of the seven ROM function commands: 1) Read RO M, 2) Match ROM, 3) Search ROM, 4) Condi- tional Search ROM, 5) Skip ROM, 6) Overdrive-Sk ip ROM or 7) Overdrive-Match ROM. Upon comple- tion of an Overdrive ROM command byte executed at standard speed, the device will enter Overdrive mode, where all subsequent communi cation occurs at a higher speed. Th e protocol required for these ROM function commands is described in Figure 13. After a ROM function command is successfully exe- cuted, the memory functions become accessible and th e master may provide any one of the seven avail- able commands. The protocol for these memory function commands is described in Figure 10. All data is read and written least significant bit first.
Figure 6. DS1921G REGISTER PAGE MAP access mode while a mission is in progress. (even read-only ones), however, will end the mission and overwrite selected writeable registers. Binary-Coded Decimal (BCD) format.
DS1921G Thermochron iButton 7 of 45 RTC and RTC Alarm Register Bitmap ADDR b7 b6 b5 b4 b3 b2 b1 b0 0200h 0 10 Seconds Single Seconds 0201h 0 10 Minutes Single Minutes 0202h 0 12/24 20h. AM/PM 10h. Single Hours 0203h 0 0 0 0 0 Day of Week 0204h 0 0 10 Date Single Date 0205h CENT 0 0 10m. Single Months 0206h 10 Years Single Years 0207h MS 10 Seconds Alarm Single Seconds Alarm 0208h MM 10 Minutes Alarm Single Minutes Alarm 0209h MH 12/24 10ha. A/P 10h. alm. Single Hours Alarm 020Ah MD 0 0 0 0 Day of Week Alarm RTC/Calendar The RTC of the DS1921G can run in either 12-hour or 24-hour mode. Bit 6 of the Hours Register (address 202h) is defined as the 12- or 24-hour mode se lect bit. When high, the 12-hour mode is selected. In the 12-hour mode, bit 5 is the AM/PM bit with logic 1 being PM. In the 24-hour mode, bit 5 is the 20- hour bit (20 to 23 hours). To distinguish between the days of the week the DS 1921G includes a counter with a range from 1 to 7. The assignment of counter value to the day of week is arbitrary. Typically, the number 1 is assigned to a Sunday (U.S. standard) or to a Monday (European standard). The calendar logic is designed to automatically compensa te for leap years. For every year value that is either 00 or a multiple of 4 the device will add a 29 th of February. This will work correctly up to (but not including) the year 2100. The DS1921G is Y2K-compliant. Bit 7 (CENT) of th e Months Register at address 205h serves as a century flag. When the Year Register rolls over from 99 to 00 the century flag will toggle. It is recom- mended to write the century bit to a 1 when setti ng the RTC to a time/date between the years 2000 and 2099. RTC Alarms The DS1921G also contains a RTC alarm function. Th e alarm registers are loca ted in registers 207h to 20Ah. The most significant bit of each of the alarm registers is a mask bit. When all of the mask bits are logic 0, an alarm will occur once per week when the values stored in timekeeping registers 200h to 203h match the values stored in the time of day alarm registers. Any alarm will set the Timer Alarm Flag (TAF) in the device's Status Register (address 214h). The bus master may set the Search Conditions in the Control Register (address 20Eh) to identify devices with timer alarms by means of the Conditional Search function (see ROM Function Commands).
DS1921G Thermochron iButton 8 of 45 RTC Alarm Control ALARM REGISTER MASK BITS (Bit 7 of 207h to 20Ah) MS MM MH MD 1 1 1 1 Alarm once per second. 0 1 1 1 Alarm when seconds match (once per minute). 0 0 1 1 Alarm when minutes and seconds match (once every hour). 0 0 0 1 Alarm when hours, minutes and seconds match (once every day). 0 0 0 0 Alarm when day, hours, minutes, and seconds match (once every week). Temperature Conversion The DS1921G measures temperatures with a resolution of 0.5°C. Temperature values are represented in a single byte as an unsigned binary nu mber, which translates into a theo retical range of 128°C. The range, however, has been limited to values from 0000 0000 (00h) through 1111 1010 (FAh). The codes 01h to F9h are considered valid temperature readings. If a temperature conversion yields a temperature that is out-of-range, it will be recorded as 00h (if too low) or FAh (if too high). Since ou t-of-range results are accumulated in histogram bins 0 and 62 (see section Temperature Logging and Histogram ) the data in these bins is of limited value. For this reason the specified temperature range of the DS1921G is considered to begin at code 04h and end at code F7h, which corresponds to histogram bins 1 to 61. With T[7..0] representing the decimal equivalent of a temperature reading, the temperature value is calculated as This equation is valid for converting temperature read ings stored in the datalog memory as well as for data read from the forced temperature conversion readout Register (address 211h). To specify the high or low temperature alarm thresholds, this equation needs to be resolved to A value of 23°C, for example, thus translates into 126 decimal or 7Eh. This corresponds to the binary patterns 0111 1110, which could be written to a Temperature Alarm Register (address 020Bh and 020Ch, respectively). Temperature Alarm Register Map ADDR b7 b6 b5 b4 b3 b2 b1 b0 020Bh Temperature Low Alarm Threshold 020Ch Temperature High Alarm Threshold
DS1921G Thermochron iButton Sample Rate The content of the Sample Rate Register (address 020Dh) determines how many minutes the temperature conversions are apart from each other during a mission. The sample rate may be any value from 1 to 255, coded as an unsigned 8-bit binary number. If the memory has been cleared (Status Register bit MEMCLR = 1) and a mission is enabled (Status Register bit EM = 0), writing a non-zero va lue to the Sample Rate Register will start a mission. For a full description of the correct sequence of steps to start a temperature- logging mission see sections Missioning or Missioning Example. 9 of 45 Sample Rate Register Map ADDR b7 b6 b5 b4 b3 b2 b1 b0 020Dh Sample Rate Control Register The DS1921G is set up for its opera tion by writing appropriate data to its special function registers that are located in the register page. Several functions that are controlled by a single bit only are combined into a single byte called Control Register (address 20E h). This register can be read and written. If the device is programmed for a mission, writing to the Control Register will end the mission and change the register contents. Control Register Bitmap ADDR b7 b6 b5 b4 b3 b2 b1 b0 020Eh EOSC EMCLR 0 EM RO TLS THS TAS The functional assignments of the individual bits are explained in the table below. Bit 5 has no function. It always reads 0 and cannot be written to 1. Control Register Details BIT DESCRIPTION BIT(S) DEFINITION EOSC: Enable Oscillator b7 This bit controls the crystal oscillator of the RTC. When set to logic 0, the oscillator will start operation. When written to logic 1, the oscillator will stop and the device is in a low-power data retention mode. This bit must be 0 for normal operation. The RTC must have advanced at least 1 second before a mission start will be accepted. EMCLR: Memory Clear Enable b6 This bit needs to be set to logic 1 to enable the Clear Memory function, which is invoked as a memory function command. The Time-Stamp, Histogram Memory as well as the Mission Time Stamp, Mission Samples Counter, Mission Start Delay and Sample Rate will be cleared only if the Clear Memory command is issued with the next access to the device. The EMCLR bit will return to 0 as the next memory function command is executed. EM: Enable Mission b4 This bit controls whether the DS1921G will begin a mission as soon as the sample rate is written. To enable the device for a mission, this bit must be 0. RO: Rollover Enable/Disable b3 This bit controls whether the temperature logging memory is overwritten with new data or whether data logging is stopped once the memory is filled with data during a mission. Setting this bit to a 1 enables the rollover and data logging continues at the beginning overwriting previously collected data. Clearing this bit to 0 disables the rollover and no further temperature values will be stored in the temperature logging memory once it is filled with data. This will not stop the mission. The device will continue measuring temperatures and updating the histogram and alarm time stamps and durations.
DS1921G Thermochron iButton 10 of 45 BIT DESCRIPTION BIT(S) DEFINITION TLS: Temperature Low Alarm Search b2 If this bit is 1, the device will respond to a Conditional Search command if during a mission the temperature has reached or is lower than the Low Temperature Threshold stored at address 020Bh. THS: Temperature High Alarm Search b1 If this bit is 1, the device will respond to a Conditional Search command if during a mission the temperature has reached or is higher than the High Temperature Threshold stored at address 020Ch. TAS: Timer Alarm Search b0 If this bit is 1, the device will respond to a Conditional Search command if during a mission a timer alarm has occurred. Since a timer alarm cannot be disabled, the TAF flag usually reads 1 during a mission. Therefore it may be advisable to set the TAS bit to a 0, in most cases. Mission Start Delay Counter The content of the Mission Start Delay Counter determines how many minutes the device will wait before starting the logging process. The miss ion start delay value is stored as unsigned 16-bit integer number at addresses 212h (low byte) and 213h (high byte). The maximum delay is 65535 minut es, equivalent to 45 days, 12 hours, and 15 minutes. For a typical mission, the Mission Star t Delay is 0. If a mission is too lo ng for a single DS1921G to store all temperature readings at the se lected sample rate, one can use se veral devices, staggering the Mission Start Delay to record the full period. In this case, th e RO bit in the control re gister (address 020Eh) must be set to 0 to prevent overwriting of the recorded temperature log after the datalog memory is full. See Mission Start and Logging Process description and flow chart for details. Status Register The Status Register holds device stat us information and alarm flags. Th e register is located at address 214h. Writing to this register will not necessarily end a mission. Status Register Bitmap ADDR b7 b6 b5 b4 b3 b2 b1 b0 0214h TCB MEMCLR MIP SIP 0 TLF THF TAF The functional assignments of the individual bits are explained in the table below. The bits MIP, TLF, THF and TAF can only be written to 0. All other bits are read-only. Bit 3 has no function. Status Register Details BIT DESCRIPTION BIT(S) DEFINITION TCB: Temperature Core Busy b7 If this bit reads 0 the DS1921G is currently performing a temperature conversion, either self-initiated because of a mission being in progress or initiated by a command when a mission is not in progress. The TCB bit goes low just before a conversion starts and returns to high just after the result is latched into the readout register at address 0211h. MEMCLR: Memory Cleared b6 If this bit reads 1, the memory pages 17 and higher (alarm time stamps/durations, temperature histogram, excluding datalog memory), as well as the Mission Time Stamp, Mission Samples Counter, Mission Start Delay and Sample Rate have been cleared to 0 from executing a Clear Memory function command. The MEMCLR bit will return to 0 as soon as writing a non-0 value to the Sample Rate Register starts a new mission, provided that the EM bit is also 0. The memory has to be cleared in order for a mission to start.
DS1921G Thermochron iButton 11 of 45 BIT DESCRIPTION BIT(S) DEFINITION MIP: Mission in Progress b5 If this bit reads 1 the DS1921G has been set up for a mission and this mission is still in progress. A mission is started if the EM bit of the Control Register (address 20Eh) is 0 and a non-zero value is written to the Sample Rate Register, address 20Dh. The MIP bit returns from logic 1 to logic 0 when a mission is ended. A mission will end with the first write attempt (Copy Scratchpad command) to any register in the address range of 200h to 213h. Alternatively, a mission can be ended by directly writing to the Status Register and setting the MIP bit to 0. The MIP bit cannot be set to 1 by writing to the status register. SIP: Sample in Progress b4 If this bit reads 1 the DS1921G is currently performing a temperature conversion as part of a mission in progress. The mission samples occur on the seconds rollover from 59 to 00. The SIP bit will change from 0 to 1 approximately 250ms before the actual temperature conversion begins allowing the circuitry of the chip to wake-up. A temperature conversion including a wake-up phase takes maximum 875ms. During this time read accesses to the memory pages 17 and higher are permissible but may reveal invalid data. TLF: Temperature Low Flag b2 Logic 1 in the Temperature Low Flag bit indicates that a temperature measurement during a mission revealed a temperature equal to or lower than the value in the Temperature Low Threshold Register. The Temperature Low Flag can be cleared at any time by writing this bit to 0. This flag must be cleared before starting a new mission. THF: Temperature High Flag b1 Logic 1 in the Temperature High Flag bit indicates that a temperature measurement during a mission revealed a temperature equal to or higher than the value in the Temperature High Threshold Register. The Temperature High Flag can be cleared at any time by writing this bit to 0. This flag must be cleared before starting a new mission. TAF: Timer Alarm Flag b0 If this bit reads 1, a RTC alarm has occurred (see TIMEKEEPING section for details). The Timer Alarm Flag can be cleared at any time by writing this bit to logic 0. Since the timer alarm cannot be disabled, the TAF flag usually reads 1 during a mission. This flag should be cleared before starting a new mission. Mission Time Stamp The Mission Time Stamp indicates the time and date of the first te mperature conversion of a mission. Subsequent temperature conversions will take place as many minutes apart from each other as specified by the value in the Sample Rate Register. Mission samples occur on minute boundaries. Mission Time Stamp Register Bitmap ADDR b7 b6 b5 b4 b3 b2 b1 b0 0215h 0 10 Minutes Single Minutes 0216h 0 12/24 20h. AM/PM 10h. Single Hours 0217h 0 0 10 Date Single Date 0218h 0 0 0 10m. Single Months 0219h 10 Years Single Years Mission Samples Counter The Mission Samples Counter indi cates how many temperature measurements have taken place during the current mission in progres s (if MIP = 1) or during the latest mission (if MIP = 0). The value is stored as an unsigned 24-bit integer number. This counter is reset through the Clear Memory command.
DS1921G Thermochron iButton 12 of 45 Mission Samples Counter Register Map ADDR b7 b6 b5 b4 b3 b2 b1 b0 021Ah Low Byte 021Bh Center Byte 021Ch High Byte Device Samples Counter The Device Samples Counter indicates how many temp erature measurements have taken place since the device was assembled at the factory. The value is stored as an unsigned 24-bit integer number. The maximum number that can be represented in this fo rmat is 16777215, which is hi gher than the expected lifetime of the DS1921G iButton. This counter cannot be reset under software control. Device Samples Counter Register Map ADDR b7 b6 b5 b4 b3 b2 b1 b0 021Dh Low Byte 021Eh Center Byte 021Fh High Byte Temperature Logging and Histogram Once setup for a mission, the DS1921G logs the temper ature measurements simultaneously byte after byte in the datalog memory as well as in histogram form in the histogram me mory. The datalog memory is able to store 2048 temperature values measured at equidistant time points. Th e first temperature value of a mission is written to addre ss location 1000h of the datalog memo ry, the second value to address location 1001h and so on. Knowing the starting time point (Mission Time Stamp) , the interval between temperature measurements, the Mission Samples Count er, and the rollover setting, one can reconstruct the time and date of each measurement stored in the datalog. There are two alternatives to the way the DS1921G will behave after the 2048 bytes of datalog memory is filled with data. With rollover disabled (RO = 0), th e device will fill the datal og memory with the first 2048 mission samples. Additional mission samples are not logged in the datalog, but the histogram, and temperature alarm ram continue to update. With rollover enabled (RO = 1), the datalog will wrap around, and overwrite previous data starting at 1000h for the every 2049th mission sample. In this mode the device stores the last 2048 mission samples. For the temperature histogram, the DS1921G provides 63 bins that begin at memory address 0800h. Each bin consists of a 16-bit, non-rolling-over binary counter that is incremented each time a temperature value acquired during a mission falls into the ra nge of the bin. The least significant byte of each bin is stored at the lower address. Bin 0 begins at memory a ddress 0800h, bin 1 at 0802h, and so on up to 087Ch for bin 62, as shown in Figure 7. The number of the bin to be updated after a temp erature conversion is determined by cutting off the two l east significant bits of the binary temperature value. Out of range values are range locked and counted as 00h or FAh.
Figure 7. Histogram Bin and Temperature Cross-Reference if all temperature readings fall into the same bin. Temperature High Flag (THF) or th e Temperature Low Flag (TLF) in the Status Register (address 214h). duration of the alarming temperature. determined from the Mission Time Stamp and the time distance between each temperature reading.
Figure 8. Alarm Time Stamps and Durations Address Map the device can perform this function, it needs to be configured. This procedure is called missioning. (also called GMT, Greenwich Mean Time) or any other time standard that was chosen for the application. and the duration of the mission. registers is described under Temperature Conversion earlier in this document.
DS1921G Thermochron iButton 15 of 45 The state of the Search Condition bits in the Cont rol Register does not affect the mission. If multiple devices are connected to form a 1-Wire net, the set ting of the search condition will enable devices to participate in the conditional search if certain events such as timer or temperature alarm have occurred. Details on the search conditions are found in the section ROM Function Commands later in this document and in the Control Register description. The setting of the RO bit (rollover enable) and sample rate depends on the duration of the mission and the monitoring requirements. If the most recent temper ature history is important , the rollover should be enabled (RO = 1). Otherwise, one should estimate the duration of the mission in minutes and divide the number by 2048 to calculate the value of the sample rate (number of minutes between temperature conversions). If the estimated duration of a mission is 10 days (= 14400 minutes) for example, then the 2048-byte capacity of the datalog memory would be sufficient to store a new value every 7 minutes. If the datalog memory of the DS1921G is not large enough to store all temperatur e readings, one can use several devices and set the Mission Start Delay to values that make the second device start recording as soon as the memory of the first device is full, and so on. The RO-bit needs to be set to 0 to disable rollover that would otherwise overwrite the recorded temperature log. After the RO bit and the Mission Start Delay are set, the Sample Rate Register is the last element of data that is written. The sample rate may be any valu e from 1 to 255, coded as an unsigned 8-bit binary number. As soon as the sample rate is written, the DS1921G will set the MIP flag and clear the MEMCLR flag. After as many minute s as specified by the Mission Start Delay are over, the device will wait for the next minute boundary, then wake up, copy the current time and date to the Mission Time Stamp Register, and make the firs t temperature conversion of the mission. This increments both the Mission Samples Counter and Device Samples Counter . All subsequent temperature measurements are taken on minute boundaries specified by the value in the Sample Rate Register. One may read the memory of the DS1921G to watch the mission as it pr ogresses. Care should be taken to avoid memory access conflicts. See section Memory Access Conflicts for details. MEMORY/CONTROL FUNCTION COMMANDS The Memory/Control Function Flow Chart (Figure 10) describes the protocols necessary for accessing the memory and the special functi on registers of the DS1921G. An example on how to use these and other functions to set up the DS1921G for a mission is included at the end of this document, preceding the Electrical Characteristics section. The communication between master and DS1921G takes place either at regular speed (default, OD = 0) or at Over drive Speed (OD = 1). If not explicitly set into the Overdrive Mode, the DS1921G assumes regular sp eed. Internal memory access during a mission has priority over external access through the 1-Wire interface. This can affect the Read Memory commands described below. See section Memory Access Conflicts for details. ADDRESS REGISTERS AND TRANSFER STATUS Because of the serial data transfer, the DS1921G em ploys three address registers, called TA1, TA2, and E/S (Figure 9). Registers TA1 and TA2 must be loaded with the target address to which the data will be written or from which data will be sent to the master upon a Read co mmand. Register E/S acts like a byte counter and transfer status register. It is used to verify data integrity with Write commands. Therefore, the master only has read access to this register. The lower 5 bits of the E/S Register indicate the address of the last byte that has been written to the scratchpad. This address is called Ending Offset. Bit 5 of the E/S Register, called PF or “partial byte fla g,” is set if the number of data bits sent by the master is not an integer multiple of 8. Bit 6 is always a 0. Note that th e lowest 5 bits of the target address also determine the address within the scratchpad, where intermediate storage of data will begin. This address is called byte offset. If the target address for a Write command is 13Ch, for example, then the scratchpad will store
the scratchpad clears this flag. Figure 9. ADDRESS REGISTERS copy the data to the requested location beginning at the target address. and the partial byte flag (PF) will be set.
DS1921G Thermochron iButton 17 of 45 generator and then shifting in th e command code (0Fh) of the Write Scratchpad command, the Target Addresses TA1 and TA2 as supplied by the master and all the data byt es. The master may end the Write Scratchpad command at any time. However, if the e nding offset is 11111b, the master may send 16 read time slots and will receive an inverted CRC16 generated by the DS1921G. The range 200h to 213h of the register page is protected during a mission. See Figure 6, Register Page Map, for the access type of the individual registers between and during missions. Read Scratchpad Command [AAh] This command is used to verify scratchpad data and target address. After issuing the Read Scratchpad command, the master begins reading. The first 2 bytes will be the target address. The next byte will be the ending offset/data status byte (E/S) followed by the scra tchpad data beginning at th e byte offset (T4:T0), as shown in Figure 9. Regardless of the actual ending offset, the master may read data until the end of the scratchpad after which it will receive an inverted CRC16 of the command code, Target Addresses TA1 and TA2, the E/S byte, and th e scratchpad data starting at the target address. After the CRC is read, the bus master will read logical 1s from the DS1921G until a reset pulse is issued. Copy Scratchpad [55h] This command is used to copy data from the scratc hpad to the writable memory sections. Applying Copy Scratchpad to the Sample Rate Register can start a mission provided that several preconditions are met. See Mission Start and Logging Process description and the flow chart in Figure 11 for details. After issuing the Copy Scratchpad command, the master must provide a 3-byte authorization pattern, which can be obtained by reading the scratchpad for verification. This pattern must exactly match the data contained in the three address registers (T A1, TA2, E/S, in that order). If the pattern matches, the AA (Authorization Accepted) flag will be set and the copy will begin. A pattern of alternating 1s and 0s will be transmitted after the data has been copied until th e master issues a reset pulse. While the copy is in progress any attempt to reset the part will be ignored. Copy typically takes 2µs per byte. The data to be copied is determined by the three a ddress registers. The scratchpad data from the begin- ning offset through the ending offset will be copied, starting at the target address. Anywhere from 1 to 32 bytes may be copied to memory with this command. The AA flag will remain at logic 1 until it is cleared by the next Write Scratchpad command. Note that C opy Scratchpad when applied to the address range 200h to 213h during a mission will end the mission. Read Memory [F0h] The Read Memory command may be us ed to read the entire memor y. After issuing the command, the master must provide the 2-byte target address. After the 2 bytes, the master reads data beginning from the target address and may continue until the end of memo ry, at which point logic 0s will be read. It is im- portant to realize that the target address registers will contain the address provided. The ending offset/data status byte is unaffected. The hardware of the DS1921G provides a means to acco mplish error-free writing to the memory section. To safeguard data in the 1-Wire environment when reading and to simultaneously speed up data transfers, it is recommended to packetize data into data packets of the size of one memory page each. Such a packet would typically store a 16-bi t CRC with each page of data to ensure rapid, error-free da ta transfers that eliminate having to read a page multiple times to veri fy whether if the received data is correct. (See Application Note 114 for the recommended file structure.)
DS1921G Thermochron iButton Figure 10-1. MEMORY/CONTROL FUNCTION FLOW CHART Master TX Memory or Control Fkt. Command 0FH Write Scratchpad DS1921 sets Scratch- pad Offset = (T4:T0) and Clears (PF, AA) Master TX Data Byte to Scratchpad Offset DS1921 sets (E4:E0) = Scratchpad Offset Master TX Reset? Scratch- pad Offset = 11111b? Master RX CRC16 of Command, Address, Data DS1921 Incre- ments Scratch- pad Offset Master RX "1"s Master TX Reset? Master TX Reset? Partial Byte Written? PF = 1 AAH Read Scratchpad Master RX Ending Offset with Data Status (E/S) Master TX Reset? Scratch- pad Offset = 11111b? Master RX CRC16 of Command, Address Data, E/S Byte, and Data Starting at the Target Address DS1921 Incre- ments Scratch- pad Offset Master RX "1"s Master TX Reset? DS1921 sets Scratch- pad Offset = (T4:T0) Master RX Data Byte from Scratchpad Offset From ROM Functions Flow Chart (Figure 13) To ROM Functions Flow Chart (Figure 13) N Y N Y N Y N Y N Y N Y Y N Y N Y N Y DS1921 sets EMCLR = 0 Master TX TA1 (T7:T0), TA2 (T15:T8) DS1921 sets EMCLR = 0 Master RX TA1 (T7:T0), TA2 (T15:T8) To Figure 10 nd Part N From Figure 10 nd Part 18 of 45
DS1921G Thermochron iButton Figure 10-2. MEMORY/CONTROL FUNCTION FLOW CHART To Figure 10 rd Part55H Copy Scratchpad Master TX E/S Byte Authorization Code Match? DS1921 Copies Scratchpad Data to Memory Copying Finished Master TX Reset? Master TX Reset? AA = 1 F0H Read Memory Master TX Reset? End of Memory? Master RX "0"s DS1921 sets Memory Address = (T15:T0) Master RX Data Byte from Memory Address Master TX TA1 (T7:T0), TA2 (T15:T8) Master RX "1"s DS1921 TX "0" DS1921 TX "1" Master TX Reset? Master RX "1"s Master TX TA1 (T7:T0), TA2 (T15:T8) DS1921 Incre- ments Address Counter N Y N Y N Y N Y N Y N Y N Y N Y N Y DS1921 sets EMCLR = 0 DS1921 sets EMCLR = 0 From Figure 10 st Part To Figure 10 st Part From Figure 10 rd Part 19 of 45
DS1921G Thermochron iButton Figure 10-3. MEMORY/CONTROL FUNCTION FLOW CHART A5H Read Mem. w/CRC DS1921 sets Memory Address = (T15:T0) Master RX Data Byte from Memory Address End of Memory? Y Master TX Reset? CRC OK? DS1921 Incre- ments Address Counter End of Page? Master RX CRC16 of Command, Address, Data st Pass); CRC16 of Data (Subsequent Passes) Master TX Reset N Y N Y Y N Decision made by DS1921 Decision made by Master Master TX TA1 (T7:T0), TA2 (T15:T8) DS1921 sets EMCLR = 0 From Figure 10 nd Part To Figure 10 nd Part To Figure 10 th Part From Figure 10 th Part N N Y Master RX
00 Byte
DS1921G Thermochron iButton Figure 10-4. MEMORY/CONTROL FUNCTION FLOW CHART 3CH Clear Memory EMCLR = 1? DS1921 clears Mission Time Stamp, Mission Samples Counter, Mission Start Delay, Sample Rate Register DS1921 sets EMCLR = 0 44H Convert Temp. Master TX Reset? DS1921 Starts Temperature Conversion Process Master TX Reset? Mission in Progress? N Y N Y N Y N Y N Y N Y DS1921 sets MEMCLR = 1 DS1921 clears Histogram Memory DS1921 clears Alarm Time Stamps and Durations DS1921 sets EMCLR = 0 Master TX Reset? N Y From Figure 10 rd Part To Figure 10 rd Part DS1921 sets TCB\\ = 0 DS1921 Performs a Temp. Conversion DS1921 copies Result to Address 0211h DS1921 sets TCB\\ = 1 Temperature Con- version Process End of Process 21 of 45
DS1921G Thermochron iButton 22 of 45 Read Memory with CRC [A5h] The Read Memory with CRC command is used to read memory data that cannot be packetized, such as the register page and the data recorded by the device during a mi ssion. The command works essentially the same way as the simple Read Memory, except for the 16-bit CRC that the DS1921G generates and transmits following the last data byte of a memory page. After having sent the command code of the Read Memory with CRC command, the bus master sends a 2- byte address (TA1 = T7:T0, TA2 = T15:T8) that indicat es a starting byte location. With the subsequent read data time slots the master receives data fr om the DS1921G starting at the initial address and continuing until the end of a 32-byte page is reached. At that point the bus master will send 16 additional read data time slots and receive an inverted 16-bit CRC. With subsequent read data time slots the master will receive data starting at the beginning of the next page followed again by the inverted CRC for that page. This sequence will continue until the bus master resets the device. With the initial pass through the Read Memory with CRC flow, the 16-bit CRC value is the result of shifting the command byte into the cleared CRC generator followed by the 2 address bytes and the contents of the data memory. Subsequent passes th rough the Read Memory with CRC flow will generate a 16-bit CRC that is the result of clearing the CRC generator and then shif ting in the contents of the data memory page. After the 16-bit CRC of th e last page is read, the bus mast er will receive logical 0s from the DS1921G and inverted CRC16s at page boundaries until a reset pulse is i ssued. The Read Memory with CRC command sequence can be ended at any point by issuing a reset pulse. Clear Memory [3Ch] The Clear Memory command is used to clear the Sample Rate, Mission St art Delay, Mission Time Stamp, and Mission Samples Counter in the register page and the Temperature Alarm Memory and the Temperature Histogram Memory. These memory areas must be cleared for the device to be set up for another mission. The Clear Memory command does not cl ear the datalog memory or the temperature and timer alarm flags in the Status Re gister. The RTC oscillator must be on and have counted at least 1 second, before issuing the command. For the Clear Memory command to function the EMCLR bit in Control Register must be set to 1, and the Clear Me mory command must be issued with the very next access to the device’s memory functions. Issuing a ny other memory function command will reset the EMCLR bit. The Clear Memory process takes 500µs. When the command is completed the MEMCLR bit in the Status Register will read 1 and the EMCLR bit will be 0. Convert Temperature [44h] If a mission is not in progress (MIP = 0) the Convert Temperature command can be issued to measure the current temperature of the device. The result of the temperature conversion will be found at memory address 211h in the register page. This command takes maximum 90ms to complete. During this time the device remains fully accessible for memory/control and ROM function commands.
registers to the Mission Time Stamp. Figure 11. MISSION START AND LOGGING PROCESS over, the Logging Process begins and the Mission Start Process ends.
DS1921G Thermochron iButton 24 of 45 Stop Mission The DS1921G does not have a specia l command to stop a mission. A mi ssion can be stopped at any time by writing to any address in the range of 0200h to 0213h or by writing the MIP bit of the Status Register at address 0214h to 0. Either appr oach involves the use of the Copy Scratchpad command. There is no need for the Mission Start Delay to expire before a mission can be stopped (see Figure 11). MEMORY ACCESS CONFLICTS While a mission is in progress, periodically a temperat ure sample is taken and st ored in the datalog, his- togram, and potentially alarm memory. This "internal activity" has priori ty over a Read Memory or Read Memory with CRC access to these pages. If a conflict occurs, the data read may be invalid, even if the CRC value matches the data. To ensure that the data r ead is valid, it is recommended to first read the SIP bit of the Status Register. If the SIP bit is set, delay reading the datalog, histogram, and alarm memory until SIP is 0. The interference is more likely to be seen with a high sample rate (1 sample every minute). Since all mission samples occur on the seconds rollover (59 to 00), memory conflicts can be avoided by first reading the RTC seconds counter. For example, if it takes two seconds to read the datalog, then avoid starting the memory read if the s econds counter is 58, 59 or 00. Alternat ively, one can read the affected memory section twice and accept the da ta only if both readings match. In any case, when writing driver software, it is important to know a bout the possibility of interference and to take m easures to work around it. 1-WIRE BUS SYSTEM The 1-Wire bus is a system that has a single bus master and one or more slaves. In all instances the DS1921G is a slave device. The bus master is typical ly a microcontroller. The discussion of this bus system is broken down into three topics: hardware conf iguration, transaction sequence, and 1-Wire signaling (signal types and timing). The 1-Wire protocol defines bus transactions in terms of the bus state during specific time slots that are in itiated on the falling edge of sync pulses from the bus master. For a more detailed protocol description, refer to Chapter 4 of the Book of DS19xx iButton Standards. HARDWARE CONFIGURATION The 1-Wire bus has only a single line by definition; it is important that each device on the bus be able to drive it at the appropriate time. To facilitate this, each device attached to the 1-Wire bus must have open drain or tri-state outputs. The 1- Wire port of the DS1921G is open-drain with an internal circuit equivalent to that shown in Figure 12. A multidrop bus consists of a 1-Wire bus with multiple slaves attached. At standard speed the 1-Wire bus has a maximum data rate of 16.3kbits per second. Th e speed can be boosted to 142kbits per second by activating the Overdrive mode. The DS1921G is not guaranteed to be fully compliant to the i Button Standard. Its maximum data rate in standard spee d mode is 15.4kbits per second and 125kbits per second in Overdrive. The value of the pullup resistor prim arily depends on the network size and load conditions. The DS1921G requires a pullup resistor of maximum 2.2kΩ at any speed. The idle state for the 1-Wire bus is high. If for any reason a transaction needs to be suspended, the bus must be left in the idle state if the transaction is to resume. If this does not occur and the bus is left low for more than 16µs (Overdrive speed) or more than 120µs (standard speed), one or more devices on the bus may be reset. Note that the DS1921G does not quite meet the full 16µs maximum low time of the normal 1-Wire bus Overdrive timing. With the DS1921G the bus must be left low for no longer than 15µs at Overdrive speed to ensure that no DS1921G on th e 1-Wire bus performs a reset. The DS1921G will communicate properly when used in conjunction with a DS2480B or DS2 490 1-Wire driver and adapters that are based on these driver chips.
DS1921G Thermochron iButton 26 of 45 Search ROM [F0h] When a system is initially brought up, the bus mast er might not know the number of devices on the 1- Wire bus or their registration numbers. By taking a dvantage of the wired-AND property of the bus, the master can use a process of elimination to identify th e registration numbers of all slave devices. For each bit of the registration number, starting with the least si gnificant bit, the bus master issues a triplet of time slots. On the first slot, each slave device particip ating in the search outputs the true value of its registration number bit. On the se cond slot, each slave device particip ating in the sear ch outputs the complemented value of its registration number bit. On the third slot, the master writes the true value of the bit to be selected. All slave devices that do not match the bit written by the master stop participating in the search. If both of the read bits are zero, the master knows that slave devices exist with both states of the bit. By choosing which state to write, the bus master branches in the romcode tree. After one complete pass, the bus master knows the registration number of a single device. Additional passes identify the registration numbers of the remaini ng devices. Refer to App Note 187: 1-Wire Search Algorithm for a detailed discussion, including an example. Conditional Search [ECh] The Conditional Search ROM command operates similarly to the Search ROM command except that only devices fulfilling the specified condition will particip ate in the search. The condition is specified by the bit functions TAS, THS, and TLS in the Control Register, address 20Eh. Th e Conditional Search ROM provides an efficient means for the bus master to de termine devices on a multidrop system that have to signal an important event, such as a temperature leaving the tole rance band. After each pass of the conditional search that successfully determined th e 64-bit ROM code for a specific device on the multidrop bus, that particular device can be indivi dually accessed as if a Match ROM had been issued, since all other devices will have dropped out of the search process and will be waiting for a reset pulse. For the conditional search, one can select any combina tion of the three search conditions by writing the associated bit to a logical 1. These bits correspond di rectly to the flags in the Status Register of the device. If the flag in th e status register reads 1 and the corresponding bit in th e Control Register is a logical 1 too, the device will respond to the Conditional Search command. If more than one bit search condition is selected, the first event occurring w ill make the device respond to the Conditional Search command. Skip ROM [CCh] This command can save time in a single-drop bus sy stem by allowing the bus master to access the memory functions without providing the 64-bit ROM code. If more than one slave is present on the bus and, for example, a Read command is issued following the Skip ROM command, data collision will occur on the bus as multiple slaves transmit simultaneou sly (open drain pulldowns will produce a wired-AND result).
DS1921G Thermochron iButton Figure 13-1. ROM FUNCTIONS FLOW CHART To Memory/Control Functions Flow Chart (Figure 10) DS1921 TX Bit 63 Master TX Bit 63 DS1921 TX Bit 63 DS1921 TX Bit 1 Master TX Bit 1 DS1921 TX Bit 1 DS1921 TX Bit 0 Master TX Bit 0 DS1921 TX Bit 0 Bit 63 Match? Bit 1 Match? Bit 0 Match? F0H Search ROM? N Y N Y Y N Y N DS1921 TX Bit 63 Master TX Bit 63 DS1921 TX Bit 63 DS1921 TX Bit 1 Master TX Bit 1 DS1921 TX Bit 1 DS1921 TX Bit 0 Master TX Bit 0 DS1921 TX Bit 0 Bit 63 Match? Bit 1 Match? Bit 0 Match? Cond. Met? ECH Cond. Search ROM? N Y N Y N Y Y N Y N Master TX Bit 63 Master TX Bit 1 Master TX Bit 0 Bit 63 Match? Bit 1 Match? Bit 0 Match? 55H Match ROM? N Y N Y Y N Y N DS1921 TX CRC Byte DS1921 TX Serial Number
6 Bytes
1 Byte
ROM? N Y From Memory/Control Func- tions Flow Chart (Figure 10) Master TX ROM Function Command DS1921 TX Presence Pulse Master TX Reset Pulse Short Reset Pulse? N Y OD = 0 1) To be transmitted or received at Overdrive speed if OD = 1. 2) The Presence Pulse will be short if OD = 1. From Figure 13 nd Part From Figure 13 nd Part To Figure 13 nd Part To Figure 13 nd Part 27 of 45
DS1921G Thermochron iButton Figure 13-2. ROM FUNCTIONS FLOW CHART 3CH Overdrive Skip ROM? N Y Master TX Bit 63 Master TX Bit 1 Master TX Bit 0 Bit 63 Match? Bit 1 Match? Bit 0 Match? 69H Overdrive Match? N Y N Y Y N Y N CCH Skip ROM? N Y 3) Always to be transmitted at Overdrive speed. OD = 1 Master TX Reset Pulse? Y N OD = 1 To Figure 13 st Part To Figure 13 st Part From Figure 13 st Part From Figure 13 st Part 28 of 45
DS1921G Thermochron iButton 29 of 45 Overdrive Skip ROM [3Ch] On a single-drop bus this command can save tim e by allowing the bus master to access the memory/control functions without providing the 64-bit ROM code. Unlike the normal Skip ROM command, the Overdrive Skip ROM sets the DS 1921G in the Overdrive mode (OD = 1). All communication following this command has to occur at Overdrive speed until a reset pulse of minimum 480µs duration resets all devices on the bus to standard speed (OD = 0). When issued on a multidrop bus this command will se t all Overdrive-supporting devices into Overdrive mode. To subsequently address a sp ecific Overdrive-supporting device, a reset pulse at Overdrive speed has to be issued followed by a Match ROM or S earch ROM command sequence. This will speed up the time for the search process. If more than one sl ave supporting Overdrive is present on the bus and the Overdrive Skip ROM command is followed by a Read command, data collision will occur on the bus as multiple slaves transmit simultaneously (open drain pulldowns will produce a wired-AND result). Overdrive Match ROM [69h] The Overdrive Match ROM command followed by a 64-bit ROM sequence transmitted at Overdrive Speed allows the bus master to address a specifi c DS1921G on a multidrop bus and to simultaneously set it in Overdrive mode. Only the DS1921G that exac tly matches the 64-bit ROM sequence will respond to the subsequent memory/control function command. Slaves already in Overdrive mode from a previous Overdrive Skip or successful Overdrive Match comm and will remain in Overdrive mode. All overdrive- capable slaves will return to st andard speed at the next Reset Pu lse of minimum 480µs duration. The Overdrive Match ROM command can be used with a single or multiple devices on the bus. 1-WIRE SIGNALING The DS1921G requires strict protocols to ensure data integrity. The protocol consists of four types of signaling on one line: Reset Sequence with Reset Puls e and Presence Pulse, Write 0, Write 1, and Read Data. Except for the presence pu lse the bus master initiates al l these signals. The DS1921G can communicate at two different speeds: standard speed a nd Overdrive speed. If not explicitly set into the Overdrive mode, the DS1921G will communicate at standard speed. While in Overdrive Mode the fast timing applies to all waveforms. To get from idle to active, the voltage on the 1-Wire line needs to fall from VPUP below the threshold VTL. To get from active to idle, the voltage needs to rise from V ILMAX past the threshold VTH. The time it takes for the voltage to make this rise is seen in Figure 14 as ‘ ε’ and its duration depends on the pullup resistor (RPUP) used and capacitance of the 1-Wire network attached. The voltage V ILMAX is relevant for the DS1921G when determining a logical level, but not for triggering any events. The initialization sequence required to begin any communication with the DS1921G is shown in Figure 14. A Reset Pulse followed by a Presence Pulse indicates the DS1921G is ready to receive data, given the correct ROM and memory function command. If the bus master uses slew-rate control on the falling edge, it must pull down the line for t RSTL + t F to compensate for the edge. A t RSTL duration of 480µs or longer will exit the Overdrive Mode returning the device to sta ndard speed. If the DS1921G is in Overdrive Mode and tRSTL is no longer than 80µs, the device will remain in Overdrive Mode.
Figure 14. INITIALIZATION PROCEDURE (RESET AND PRESENCE PULSES) for tPDL. To detect a presence pulse, the master must test the logical state of the 1-Wire line at tMSP. definitions of the write and read time slots are illustrated in Figure 15. data line will be sampled during a write time slot and how long data will be valid during a read time slot. crossed, the DS1921G needs a recovery time tREC before it is ready for the next time slot.
Figure 15. READ/WRITE TIMING DIAGRAM line low at all, and the voltage starts rising as soon as tRL is over.
DS1921G Thermochron iButton 32 of 45 CRC GENERATION With the DS1921G there are two different types of Cyclic Redundancy Checks (CRCs). One CRC is an 8-bit type and is stored in the most significant byte of the 64-bit RO M. The bus master can compute a CRC value from the first 56 bits of the 64-bit ROM and compare it to the value stored within the DS1921G to determine if the ROM data has been received error-free. The equivalent polynomial function of this CRC is X8 + X5 + X4 + 1. This 8-bit CRC is received in the true (non-inverted) form. It is computed at the factory and lasered into the ROM. The other CRC is a 16-bit type, ge nerated according to the standardized CRC16-polynomial function X16 + X15 + X2 + 1. This CRC is used for error detection when reading data memory using the Read Memory with CRC command and for fast ve rification of a data transfer when writing to or reading from the scratchpad. In contrast to the 8-bit CRC, the 16-bit CRC is always communicated in the inverted form. A CRC-generator inside the DS1921G chip (Figure 16) will calculate a new 16-bit CRC as shown in the command flow chart of Figure 10. The bus master compares the CRC value read from the device to the one it calculates from the data and decides whether to continue with an operati on or to reread the portion of the data with the CRC e rror. With the initial pass through the Read Memory with CRC flow chart, the 16-bit CRC value is the result of shifting the command byte into the cleared CRC generator, followed by the 2 address bytes and the data bytes. Subsequent passes through the Read Memory with CRC flow chart will generate a 16-bit CRC that is the result of clea ring the CRC generator and th en shifting in the data bytes With the Write Scratchpad command the CRC is gene rated by first clearing th e CRC generator and then shifting in the command code, the Target Addresse s TA1 and TA2 and all the data bytes. The DS1921G will transmit this CRC only if the da ta bytes written to the scratchpad include scratchpad ending offset 11111b. The data may start at any location within the scratchpad. With the Read Scratchpad command the CRC is gene rated by first clearing th e CRC generator and then shifting in the command code, the Target Addresses TA1 and TA2, the E/S byte, and the scratchpad data starting at the target a ddress. The DS1921G will transmit this CRC only if the reading continues through the end of the scratchpad, regardless of the actual ending offset. For more information on generating CRC values see Application Note 27 or the Book of DS19xx i Button Standards.
Figure 16. CRC-16 HARDWARE DESCRIPTION AND POLYNOMIAL
DS1921G Thermochron iButton Command-Specific 1-Wire Communication Protocol — Color Codes Master to slave Slave to master Write Scratchpad, reaching the end of the Scratchpad RST PD Select WS TA <data to EOS> CRC16\\ FF loop Write Scratchpad, not reaching the end of the Scratchpad RST PD Select WS TA <data> RST PD Read Scratchpad RST PD Select RS TA-E/S <data to EOS> CRC16\\ FF loop Copy Scratchpad (success) RST PD Select CPS TA-E/S AA loop Copy Scratchpad (invalid TA-E/S) RST PD Select CPS TA-E/S FF loop Read Memory (success) RST PD Select RM TA <data to EOM> 00 loop Read Memory (invalid address) RST PD Select RM TA 00 loop Reading reserved pages 20 through 63 or 68 thr ough 127 or pages 192 and higher (beyond datalog memory) will result in 00h bytes. Read Memory with CRC (success) RST PD Select RMC TA <data to EOP> CRC16\\ <32 bytes> CRC16\\ 34 of 45 The "32 bytes" are either valid page data or 00h bytes when reading reserved pages 20 through 63 or 68 through 127 or pages 192 and higher (beyond datalog memory). Loop
DS1921G Thermochron iButton Read Memory with CRC (invalid address) RST PD Select RMC TA <00 to EOP> CRC16\\ <32 bytes> CRC16\\ Loop The "32 bytes" are all 00h. Clear Memory RST PD Select CM FF loop To verify success, read the Status Register at address 0214h. If MEMCLR is 1, the command was executed successfully. Convert Temperature RST PD Select CT FF loop To read the result and to verify success, read the addresses 0211h (result) and the Device Samples Counter at address 021Dh to 021Fh. If the c ount has incremented, th e command was executed successfully. 35 of 45
DS1921G Thermochron iButton 36 of 45 MISSION EXAMPLE: PREPARE AND START A NEW MISSION Assumption: The previous mission has come to an end. To end an ongoing mission write the MIP bit in the Status Register to 0. The preparation of a DS1921G for a mission including the start of the mission requires up to four steps: Step 1: set the RTC (if it needs to be adjusted) Step 2: clear the data of the previous mission Step 3: set the search condition and mission start delay, clear alarm flags Step 4: set the temperature alarms and write the sample rate to start the mission STEP 1 Let the actual time be 15:30:00 hours on Monday, the 1 st of April in 2002. This results in the following data to be written to the RTC registers: Address: 200h 201h 202h 203h 204h 205h 206h Data: 00h 30h 15h 01h 81h 04h 02h With only a single DS1921G connected to the bus master, the communication of step 1 is as follows: MASTER MODE DATA (LSB FIRST) COMMENTS TX (Reset) Reset pulse (480μs to 960µs) RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 0Fh Issue Write Scratchpad command TX 00h TA1, beginning offset = 00h TX 02h TA2, address = 0200h TX <7 data bytes> Write 7 bytes of data to scratchpad TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX AAh Issue Read Scratchpad command RX 00h Read TA1, beginning offset = 00h RX 02h Read TA2, address = 0200h RX 06h Read E/S, ending offset = 6h, flags = 0h RX <7 data bytes> Read scratchpad data and verify TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 55h Issue Copy Scratchpad command TX 00h TX 02h TX 06h TA1 TA2 (AUTHORIZATION CODE) E/S TX (Reset) Reset pulse RX (Presence) Presence pulse
DS1921G Thermochron iButton 37 of 45 STEP 2 Set the EMCLR bit to 1, enable the RTC and th en execute the Clear Memory command. The RTC oscillator must be stable before the Clear Memory command is issued. Wait 500 µs after issuing the Clear Memory command before proceeding to Step 3. This re sults in the following data to be written to the Status Register: Address: 20Eh Data: 40h With only a single DS1921G connected to the bus master, the communication of step 2 is as follows: MASTER MODE DATA (LSB FIRST) COMMENTS TX (Reset) Reset pulse (480μs to 960µs) RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 0Fh Issue Write Scratchpad command TX 0Eh TA1, beginning offset = 0Eh TX 02h TA2, address = 020Eh TX 40h Write status byte to scratchpad TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX AAh Issue Read Scratchpad command RX 0Eh Read TA1, beginning offset = 0Eh RX 02h Read TA2, address = 020Eh RX 0Eh Read E/S, ending offset = 0Eh, flags = 0h RX 40h Read scratchpad data and verify TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 55h Issue Copy Scratchpad command TX 0Eh TX 02h TX 0Eh TA1 TA2 (AUTHORIZATION CODE) E/S TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 3Ch Issue Clear Memory command TX (Reset) Reset pulse RX (Presence) Presence pulse
DS1921G Thermochron iButton 38 of 45 STEP 3 In this example, the rollover is disabled and the s earch condition is set for a high temperature only. The mission is to start with a delay of 90 (005Ah) minutes and the alarm flags TLF, THF, and TAF are cleared. This results in the following data to be written to the special function registers: Address: 20Eh 20Fh 210h 211h 212h 213h 214h Data: 02h 00h* 00h* 00h* 5Ah 00h 00h * Writing through address locations 20Fh to 211h is faster than accessing the Mission Start Delay Register in a separate cycle. The write attempt has no effect on the contents of these registers. With only a single DS1921G connected to the bus master, the communication of step 3 is as follows: MASTER MODE DATA (LSB FIRST) COMMENTS TX (Reset) Reset Pulse (480μs to 960µs) RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 0Fh Issue Write Scratchpad command TX 0Eh TA1, beginning offset = 0Eh TX 02h TA2, address = 020Eh TX <7 data bytes> Write 7 bytes of data to scratchpad TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX AAh Issue Read Scratchpad command RX 0Eh Read TA1, beginning offset = 0Eh RX 02h Read TA2, address = 020Eh RX 14h Read E/S, ending offset = 14h, flags = 0h RX <7 data bytes> Read scratchpad data and verify TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 55h Issue Copy Scratchpad command TX 0Eh TX 02h TX 13h TA1 TA2 (AUTHORIZATION CODE) E/S TX (Reset) Reset pulse RX (Presence) Presence pulse
DS1921G Thermochron iButton 39 of 45 STEP 4 In this example, the temperature alarms are set to -5 °C for the low temperature threshold and 0 °C for the high temperature threshold. The sample rate is once every 10 minutes, allowing the mission to last up to 14 days. This results in the following data to be written to the special function registers: Address: 20Bh 20Ch 20Dh Data: 46h 50h 0Ah With only a single DS1921G connected to the bus master, the communication of step 4 is as follows: MASTER MODE DATA (LSB FIRST) COMMENTS TX (Reset) Reset pulse (480μs to 960µs) RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 0Fh Issue Write Scratchpad command TX 0Bh TA1, beginning offset = 0Bh TX 02h TA2, address = 020Bh TX <3 data bytes> Write 3 bytes of data to scratchpad TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX AAh Issue Read Scratchpad command RX 0Bh Read TA1, beginning offset = 0Bh RX 02h Read TA2, address = 020Bh RX 0Dh Read E/S, ending offset = 0Dh, flags = 0h RX <3 data bytes> Read scratchpad data and verify TX (Reset) Reset pulse RX (Presence) Presence pulse TX CCh Issue Skip ROM command TX 55h Issue Copy Scratchpad command TX 0Bh TX 02h TX 0Dh TA1 TA2 (AUTHORIZATION CODE) E/S TX (Reset) Reset pulse RX (Presence) Presence pulse If step 4 was successful, the MIP bit in the Status Re gister will be 1, the MEMCLR bit will be 0, and the mission start delay will be counting down.
DS1921G Thermochron iButton 40 of 45 PHYSICAL SPECIFICATION Size See mechanical drawing Weight 3.3g Safety Meets UL#913 (4th Edit.); Intrinsically Safe Apparatus, approval under Entity Concept for use in Class I, Division 1, Group A, B, C, and D Locations ABSOLUTE MAXIMUM RATINGS* IO Voltage to GND -0.5V, +6V IO Sink Current 20mA Temperature Range -40°C to +85°C Storage Temperature Range -40°C to +50°C * This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the opera tion sections of this specifica tion is not implied. Exposure to absolute maximum rating conditions for extended periods of time may affect reliability. ** Storage or operation above 50°C significantly reduces battery life. ELECTRICAL CHARACTERISTICS (VPUP = 2.8V to 5.25V, TA = -40°C to +85°C) PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS NOTES IO pin general data 1-Wire Pullup Resistance RPUP 2.2 kΩ 1, 2 Input Capacitance CIO 100 800 pF 3, 16 Input Load Current IL IO pin at VPUP 10 µA 4 High-to-Low VPUP > 4.5V 1.14 2.70 5, 6, 7, Switching Threshold VTL 0.71 2.70 V 16 Input Low Voltage VIL 0.30 V 1, 5, 8 Low-to-High VPUP > 4.5V 1.00 2.70 5, 6, 9, Switching Threshold VTH 0.66 2.70 V 16 Output low voltage at 4mA VOL 0.4 V 5, 10 Standard Speed, RPUP = 2.2kΩ 5 Overdrive Speed, RPUP = 2.2kΩ 2 Recovery Time tREC Overdrive Speed, directly prior to reset pulse; RPUP = 2.2kΩ µs 1, 16 Standard Speed 65 Timeslot Duration tSLOT Overdrive Speed 8 µs 1, 15
DS1921G Thermochron iButton 41 of 45 PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS NOTES IO pin, 1-Wire Reset, Presence detect cycle Standard Speed, VPUP > 4.5V 480 640 Standard Speed 540 640 Reset Low Time tRSTL Overdrive Speed 48 80 µs 1, 15 Presence Detect High Standard Speed 15 60 Time tPDH Overdrive Speed 1.1 6 µs 15 Presence Detect Low Standard Speed 60 270 Time tPDL Overdrive Speed 7.5 24 µs 15 Presence Detect Standard Speed 60 75 Sample Time tMSP Overdrive Speed 6 8.6 µs 1, 16 IO pin, 1-Wire Write Standard Speed 60 120 Write-0 Low Time tW0L Overdrive Speed 6 15 µs 1, 15 Standard Speed 5 15 - ε Write-1 Low Time tW1L Overdrive Speed 1 2 - ε µs 1, 11 IO pin, 1-Wire Read Standard Speed 5 15 - δ Read Low Time tRL Overdrive Speed 1 2 - δ µs 1, 12 Standard Speed tRL + δ 15 Read Sample Time tMSR Overdrive Speed tRL + δ 2 µs 1, 12 Real Time Clock Frequency Deviation ΔF -5°C to +46°C -48 +46 PPM Temperature Converter Tempcore Operating Range TTC -40 +85 °C Conversion Time tCONV 19 90 ms Thermal Response Time Constant τRESP 130 s 13 -30°C to +70°C -1.0 +1.0 Conversion Error Δϑ °C 17, 18 Number of Conversions NCONV (see graphs) --- 14, 16 NOTES 1) System Requirement. 2) Maximum allowable pullup resistance is a function of the number of 1-Wire devices in the system and 1-Wire recovery times. The specified value here applies to systems with only one device and with the minimum 1-Wire recovery times. For more heavily loaded systems, an active pullup such as that found in the DS2480B may be required. 3) Capacitance on IO could be 800pF when power is first applied. If a 2.2kΩ resistor is used to pull up the data line, 2.5µs after VPUP has been applied the parasite capacitor will not affect normal communication. 4) Input load is to ground. 5) All voltages are referenced to ground. 6) VTL, VTH are a function of the internal supply voltage.
DS1921G Thermochron iButton 42 of 45 7) Voltage below which, during a falling edge on IO, a logic 0 is detected. 8) The voltage on IO needs to be less or equal to VILMAX whenever the master drives the line low. 9) Voltage above which, during a rising edge on IO, a logic 1 is detected. 10) The I-V characteristic is linear for voltages less than 1V. 11) ε represents the time required for the pullup circuitry to pull the voltage on IO up from VIL to VTH. 12) δ represents the time required for the pullup circuitry to pull the voltage on IO up from VIL to the input high threshold of the bus master. 13) This number was derived from a test conducted by Cemagref in Antony, France, in July of 2000. http://www.cemagref.fr/English/index.htm Test Report No. E42 14) The number of temperature conversions (= Samples) possible with the built-in energy source depends on the operating and storage temperature of the device. When not in use for a mission, the RTC oscillator should be turned off and device should be stored at a temperature not exceeding 25°C. Under this condition the shelf life time is 10 years minimum. 15) Highlighted numbers are not in compliance with the published iButton standards. See comparison table below. 16) These values are derived from simulation across process, voltage, and temperature and are not production tested. 17) Total accuracy is Δϑ plus 0.25°C quantization due to the 0.5°C digital resolution of the device. 18) WARNING: Not for use as the sole method of measuring or tracking temperature and/or humidity in products and articles that could affect the health or safety of persons, plants, animals, or other living organisms, including but not limited to foods, beverages, pharmaceuticals, medications, blood and blood products, organs, flammable, and combustible products. User shall assure that redundant (or other primary) methods of testing and determining the handling methods, quality, and fitness of the articles and products should be implemented. Temperature and/or humidity tracking with this product, where the health or safety of the aforementioned persons or things could be adversely affected, is only recommended when supplemental or redundant information sources are used. Data logger products are 100% tested and calibrated at time of manufacture by Dallas Semiconductor/Maxim to ensure that they meet all data sheet parameters, including temperature accuracy. User shall be responsible for proper use and storage of this product. As with any sensor-based product, user shall also be responsible for occasionally rechecking the temperature accuracy of the product to ensure it is still operating properly. Standard Values DS1921G Values Parameter Standard Speed Overdrive Speed Standard Speed Overdrive Speed Name min max min max min max min max tRSTL 480µs (undef.) 48µs 80µs 540µs 640µs 48µs 80µs tPDH 15µs 60µs 2µs 6µs 15µs 60µs 1.1µs 6µs tPDL 60µs 240µs 8µs 24µs 60µs 270µs 7.5µs 24µs tW0L 60µs 120µs 6µs 16µs 60µs 120µs 6µs 15µs 1) Intentional change, longer recovery time between time slots.
DS1921G Thermochron iButton RTC Deviation vs Temperature -10 - 4 0 - 3 0 - 2 0 - 1 00 1 02 03 04 05 06 07 08 0 Temperature (°C) RTC Deviation (Minutes/Month) Lower Limit Upper Limit Minimum Product Lifetime vs Temperature at Different Sample Rates 0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 - 4 0 - 3 0 - 2 0 - 1 0 0 1 02 03 04 05 06 07 08 0 Temperature (°C) Min. Product Lifetime (years) Every Minute Every 3 Min. Every 10 Min. No Samples Osc. Off 43 of 45
DS1921G Thermochron iButton Minimum Product Lifetime vs Sample Rate at Different Temperatures 0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 1 10 100 1000 Minutes between Samples Minimum Product Lifetime (years) 50°C 55°C 60°C 70°C 85°C Accuracy Limits -1.5 -0.5 0.5 1.5 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 Temperature in °C Accuracy in °C Upper Limit Lower Limit 44 of 45
DS1921G Thermochron iButton 45 of 45
Revision History
Added bullet “Water resistant or waterproof if placed inside DS9107 iButton capsule (Exceeds Water Resistant 3 ATM requirements)”. Deleted “application pending” from UL bullet and safety statement. Add text to APPLICATION section: Note that the initial sealing level of DS1921G achieves IP56. Aging and use conditions can degrade the integrity of the seal over time, so for applications with significant exposure to liquids, sprays, or other similar environments, it is recommended to place the Thermochron in the DS9107 i Button capsule. The DS9107 provides a watertight enclosure that has been rated to IP68 (See www.maxim-ic.com/AN4126). 1, 2