TECHNICAL REFERENCE I2C Protocol Implementation HMM105 Humidity Module M211638EN-A
PUBLISHED BY Vaisala Oyj Street address: Mailing address: Phone: Fax: Vanha Nurmijärventie 21, FI-01670 Vantaa, Finland P.O. Box 26, FI-00421 Helsinki, Finland +358 9 8949 1 +358 9 8949 2227 Visit our Internet pages at www.vaisala.com.
_________________________________________________________________________________ Table of Contents CHAPTER 1 GENERAL INFORMATION ............................................................................ 2 About This Manual ................................................................... 2 Version Information ................................................................. 2 Related Manuals ....................................................................... 2 CHAPTER 2 2 I C INTERFACE ........
Technical Reference _________________________________________________________________ CHAPTER 1 GENERAL INFORMATION About This Manual This manual describes the I2C interface implementation of the Vaisala HUMICAP® Humidity Module HMM105. Version Information Table 1 Manual Code M211638EN-A Manual Revisions Description May 2014. First version.
Chapter 2 _______________________________________________________________ I2C Interface CHAPTER 2 I2C INTERFACE Overview HMM105 has an inter-integrated circuit (I2C) interface for interfacing with the incubator’s control computer. HMM105 implements I2C slave functionality, with the incubator’s computer acting as the master. The interface can be used to read measurement values and status information, set operation parameters, and make adjustments.
Technical Reference _________________________________________________________________ Table 3 HMM105 Signal and Power Connector X6 Connector Pinout 9 75 3 1 10 8 6 4 2 Pin # 6, 8 5, 7 1, 3 2, 4 9, 10 Function Supply voltage input 10 ... 35 VDC or 24 VAC Ground 2 5 V I C bus SDA 2 5 V I C bus SCL Not connected Communication Parameters HMM105 supports a maximum clock speed of 50 kHz. Protocol bits are sent most significant bit (MSB) first. Parameter bytes are sent using little endian order.
Chapter 2 _______________________________________________________________ I2C Interface Communication Flow Basic communication flow always includes I2C write and read commands. First the master writes a command to the slave device, and then the master reads the results of that command from the slave. When the master reads data from the slave, there is an ACK/NACK-bit in the status byte that informs the master whether or not communication was success.
Technical Reference _________________________________________________________________ HMM105 State Machine The main and initial state of the HMM105 is Idle, and it will change to WaitResponse state only when a valid invoke is received. In WaitResponse state HMM105 expects to see an I2C read operation. After seeing a read operation the HMM105 outputs its response with ACK/NACK and status signals.
Chapter 2 _______________________________________________________________ I2C Interface Examples of Communication Flow The basic data transfer communication flows are presented in the following figures. Each arrow represents an I2C read or write operation The examples are simplified presentations. For actual message content, see section Commandson page 11. For example, Figure 3 below shows the following message sequence: Master 2.
Get_Parameter,RH_ID I2C Write Slave Master Technical Reference _________________________________________________________________ Get_Parameter,RH_ID,nan,NACK I2C Read 1401-022 Figure 5 Get_Parameter with NACK Get_Parameter, RH_ID,66.55, Alarm bit = 1, ACK I2C Read Get_Parameter,Status_ID I2C Write Slave Master Get_Parameter,RH_ID I2C Write Get_Parameter,Status_ID,statusword,ACK I2C Read 1401-021 Figure 6 NOTE Get_Parameter with Alarm Alarm can be any of the state bits in status byte.
Chapter 2 _______________________________________________________________ I2C Interface Timing The minimum time delay that the master must wait between the invoke and response messages depends on the operation. If the operation includes a write to the non-volatile memory, it takes more time than other operations.
Technical Reference _________________________________________________________________ Status Word Status word is used to monitor the status of the HMM105 device. It can be read in the same way as any other slave parameter. Status word is used as 32-bit long bit field. Each bit represents a state of some error or other essential status. Changes in status word bits can be monitored by reading the status byte. See section Status Byte on page 9.
Chapter 2 _______________________________________________________________ I2C Interface Commands Get_Interface_Version The Get_Interface_Version command (ID 80h) reads the interface version information. Recommended for verifying version compatibility before reading or writing parameters.
Technical Reference _________________________________________________________________ Get_Parameter The Get_Parameter command (ID 81h) reads parameter values. You can use it to read both measurement results and operational parameters. If the number of bytes the master tries to read exceeds the message size, the slave sends FFh bytes.
Chapter 2 _______________________________________________________________ I2C Interface Example: Read RH Measurement Result Table 15 Get_Parameter Invoke Message Example Message Bytes (hex) 2F 81 2F 06 4F 6A D4 Table 16 Content 2 I C address Get_Parameter command Device address Frame length RH Parameter ID CRC high CRC lo Get_Parameter Response Message Example Message Bytes (hex) 2F 00 81 09 0B 4F D4 E4 66 41 85 6A Content 2 I C address Status byte (no errors, ACK) Get_Parameter command Device addre
Technical Reference _________________________________________________________________ Set_Parameter The Set_Parameter command (ID 82h) writes parameter values to nonvolatile memory. You can use it to set the operational parameters of the HMM105. Depending on the change, the functionality of the HMM105 may not change immediately. The length of the invoke message varies depending on the data length. The master must write as many bytes as indicated in the frame length of the invoke message.
Chapter 2 _______________________________________________________________ I2C Interface Example: Set Compensation Pressure Table 20 Example Set_Parameter Invoke Message Message Bytes (hex) 2F 82 2F 0A 40 00 00 7A 44 D8 31 Table 21 Content 2 I C address Set_Parameter command Device address Frame length Parameter ID of compensation pressure Pressure 1000 hpa CRC high CRC lo Example Set_Parameter Response Message Message Bytes (hex) 2F 04 82 2F 08 40 00 D6 5C Content 2 I C address Status byte (error a
Technical Reference _________________________________________________________________ Get_Parameter_Info The Get_Parameter_Info command (ID 83h) reads the properties of a single parameter from the HMM105. The command is useful for adapting to parameters that have been added in a new software version. If the requested parameter ID is not valid, data type Unknown Parameter ID is returned.
Chapter 2 _______________________________________________________________ I2C Interface Adjust The Adjust command (ID 84h) controls the user adjustment sequence of the HMM105.
Technical Reference _________________________________________________________________ Table 30 Code 0 1 2 3 4 Adjustment Return Codes Meaning Ok Function not supported Sequence error Recorded-Reference difference too large 2-point adjustment: Points too close Adjusting Measurement HMM105 can be adjusted while it remains installed in an incubator. Create the reference environment inside the chamber, and use the Adjust command to perform the adjustment sequence.
Chapter 2 _______________________________________________________________ I2C Interface Data Registers The register table describes all available parameters and their properties. The properties are: parameter meaning, ID, name, data type, length and persistence. Persistence defines if the parameter is saved in EEPROM (non-volatile memory) or in RAM. Make sure not to write excessively to the EEPROM, as it has a maximum lifetime of approximately 30000 cycles.
Technical Reference _________________________________________________________________ Register Table Table 32 HMM105 Register Table Meaning Name ID Read/ Write Persistent Other Factory information Device Address Size Type (bytes) ADDR 0 1 Byte R Yes Device serial number SNUM Sensor number SSNUM Component board CBNUM number Software version number VERS Factory calibration date CDATE DDMMYYYY Factory calibration info CTEXT General parameters and variables 1 2 3 12 12 12 Str Str Str R R R
www.vaisala.