I2C Message Overview; Processing Time Delay; Clock, Start, Stop, Direction; Acknowledge & Nack - Ladybug LB5900 Series Interface Manual

Power sensor, spi & i2c interface
Hide thumbs Also See for LB5900 Series:
Table of Contents

Advertisement

I2C Message Overview

Commands with no required response can be sent with a single communication if the sensor is
not busy. Queries require at least two communications, one to start a function, such as a
measurement, then a second to read back the resultant data. After the request is made to the
sensor, the master (user controller) is required to allow sufficient time for the sensor to process
the function prior to requesting data. During the time the sensor is processing data, the master
can address other sensors. For example, a routine could be created to start measurements on
two sensors, then go back and read each one after a period of time has elapsed. NACK, as
explained later in this document, can be used to determine if the sensor has completed the
function and is no longer busy.
Once a command is received, Processing begins when the stop condition, detailed below, is
sent by the master (user controller). For example, when issuing a READ?, the process of
collecting the averaged measurement begins when the stop condition is issued by the master
(user controller).

Processing Time Delay

In order for the sensor to process data and to prepare additional data, a minimum of 1ms is
required after any command is sent. The master should not send any requests during this time.

Clock, Start, Stop, Direction

The Clock (SCL) is always generated by the master (user controller). All messages begin with a
start condition and are terminated by a stop condition. Start and stop conditions are always
generated by the master (user controller). After a start condition is issued, the bus is considered
to be busy and cannot be used for any other transactions until a stop condition occurs. A period
of time (t
) is required after the stop condition. Data bytes are transferred with the MSB (Most
buff
Significant Bit) first out. Each byte must be acknowledged by the receiver.
When the master is transmitting data, it sets direction (R/W ̅ ) to zero, when requesting data from
a sensor, the master sets the bit to a one.
A start condition occurs when the master lowers the SDA line while the SCL line is high.
A stop condition occurs when the master raises the SDA line while the SCL line is high.
Acknowledge & NACK
I2C is a based on standard 8 bit (byte) communications, however there is an extra 9'th
(ACK/NACK) bit that is used to acknowledge transfers and is not part of the data being sent. So
that the slave (sensor) can acknowledge receipt of transmissions, the master (user controller)
releases the SDA line after the 8'th bit of each byte. This allows the sensor to control the line and
place it in a low state to acknowledge the transfer on the 9'th clock cycle. If the line remains high
during the acknowledge cycle, the sensor is sending a NACK (Not Acknowledge) indicating that an
error in the message has occurred or that it is not ready. NOTE: NACK is not used to identify SCPI
command errors. The status byte should be read to check for the presence errors. The master
(user controller) must manage this condition.
NACK issued by the master (user controller), (master NACK) when receiving data from the sensor
may be used to indicate that the master does not require further data and considers the
DOC: SPII2CHDWBrief - V2.71 07/25/2017
PAGE 9

Advertisement

Table of Contents
loading

Table of Contents