Command Header 06H - Read Status & Length - Ladybug LB5900 Series Interface Manual

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

Advertisement

Command Header 06h - Read Status & Length
Figure 24 details the communications for Command Header 06h with an LB5900 sensor.
Command Header 06h returns the Sensor Status and the length of any available data. The
command is always be 6 bytes in total length, an error will result and be returned on the next
commination if the length is not correct. As with all LB5900 SPI communications, data is clocked
out of the sensor as the command and don't care bits are clocked in. As can be seen from Figure
24, don't care data is clocked in after the command to provide the proper number of clocks for the
returned data.
Figure 24 - Command Header 06h Details
Referring to Figure 24 and the first byte, as the command is clocked in, the sensor availability is
returned. This first "busy" byte is the same with all Command Headers. If zero (binary) is
returned, the sensor is available and the command will function as expected. This is separate from
the Sensor's measurement completion flag. Measurement completion is indicated by bit 4 of the
status byte, however this byte is not valid if the first byte indicates sensor is not ready. All six
bytes should be read, even if zero is not returned.
The second byte indicates the status of the last communication as detailed in the Command Header
section. This byte IS valid regardless of the sensor's busy byte.
The third byte will contain the Sensor's Status Byte if the busy byte is zero. Use bit 4 of this byte
to determine if the sensor has data ready. This bit will be zero if the sensor has not completed a
measurement, or other return data function is not ready; however the status byte is not valid unless
the first "busy" byte is zero.
If bit 4 of the third byte is 1, it indicates that data is available and the binary value of the last three
bytes of the 6-byte communication indicates the length of the available message (less the message
terminator). The length of return can be between 0 and 4095 bytes including the required
terminator.
DOC: SPII2CHDWBrief - V2.71 07/25/2017
PAGE 26

Advertisement

Table of Contents
loading

Table of Contents