beautypg.com

Communication flow, Basic communication flow always includes i, C interface – Vaisala HMM105 User Manual

Page 7: Table 7 response message in hmm105 i

background image

Chapter 2 _______________________________________________________________ I2C Interface

VAISALA _____________________________________________________________________ 5

Communication Flow

Basic communication flow always includes I

2

C 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. ACK is defined as zero and NACK is defined as one in the

logical level.

NOTE

This ACK/NACK refers to message level acknowlegde. I

2

C protocol

includes separate byte level acknowledge.

Command messages sent by the master are called invokes. Replies sent

by the slave are called responses. Note that also responses include the

device address.

Table 6

Invoke Message in HMM105 I

2

C Interface

Message Segment Length

Content

Start

I

2

C start condition.

I

2

C address

1 byte

See Table 4 on page 4.

Command

1 byte

Identifier of command.

Device address

1 byte

See Table 5 on page 4.

Frame length

1 byte

Length of invoke message in bytes

(excluding I

2

C address, including CRC).

Minimum invoke frame length is 5 bytes.

Data

Variable length Content and length depending on the

command. May be left out if command

contains no data in the invoke message.

Checksum

2 bytes

See section Checksum on page 9.

Stop

I

2

C stop condition

Table 7

Response Message in HMM105 I

2

C Interface

Message Segment Length

Content

Start

I

2

C start condition.

I

2

C address

1 byte

See Table 4 on page 4.

Status

1 byte

See section Status Byte on page 9.

Command

1 byte

Identifier of the command that was used

in the invoke that the slave is

responding to. If slave is in idle state (no

valid invoke), command code is FFh.

Device address

1 byte

See Table 5 on page 4.

Frame length

1 byte

Length of the response message in

bytes (excluding I

2

C address, including

CRC). The minimum response frame

length is 6 bytes.

Data

Variable length Content and length depending on the

command.

Checksum

2 bytes

See section Checksum on page 9.

Stop

I

2

C stop condition