4 confirm new data ready, 1 status register (0x34), 5 read the measurement results – PNI RM3100 Sensor Suite User Manual

Page 36: Confirm new data ready, Status register (0x34), Read the measurement results

Advertising
background image

PNI Sensor Corporation

Doc 1017252 r03

RM3100 & RM2100 Sensor Suite User Manual

Page 35 of 45

5.4 Confirm New Data Ready

There are several ways to determine if a measurement has been completed and data is

available in the Measurement Results Registers. One method is monitoring the DRDY line

for it to go HIGH. Recall that for continuous measurement mode, the DRDM bits of the

Continuous Measurement Command byte establish the conditions for DRDY to go HIGH.

Another option when using the SPI interface is monitoring the MISO pin for it to go HIGH.

(The MISO pin is unavailable when using the I

2

C interface, as it is used to set the slave

address of the device.) Another option is to read from the STATUS register, as discussed

below. Only one method need be used.

5.4.1 STATUS Register (0x34)

To read the Status Register, first send a read command to the STATUS register, 0xB4.

The return byte provides the contents of the Status Register:

Bit #

7

6

5

4

3

2

1

0

Value DRDY

-

-

-

-

-

-

-

Bit 7 will be HIGH if data is available and LOW if it is unavailable. Bits 0 – 6 are

indeterminate and should be ignored.

5.5 Read the Measurement Results

Each sensor reading consists of 3 bytes of data which are stored in 2’s complement format

(range: -8388608 to 8388607) in the Results Registers within the MagI2C. These registers

are read by sending the Read Results byte, as defined below, where the values of A, B, C,

and D establish the register to be addressed, as given in Table 5-8.

Bit #

7

6

5

4

3

2

1

0

Value

1

0

1

0

A

B

C

D

Advertising