AK8975 3-axis magnetometer

The AK8975/B is a 3-axis electronic compass IC with high-sensitivy Hall sensor technology. The small package of AK8975/B incorporates magnetic sensors for detecting terrestrial magnetism in the X-axis, Y-axis, and Z-axis, a sensor driving circuit, signal amplifier chain, and an arithmetic circuit for processing the signal from each sensor. Self-test function is also incorporated. With its compact footprint and thin package, it is suitable for map heading detection in GPS-equipped cellphones or almost any kind of pedestrian navigation function.

I2C Data Capture Dumps

Help and FAQ

There are no questions and answers given for this device at this time.

Do you have a question that isn't answered here or elsewhere in the source code, documentation, or examples for this device? Ask away!

Register Map

 R/WBit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
[0x00] WIA

Device ID (WIA @ 0x00)

Register Bitfields

  • [7:0] WIA
RO[7:0] WIA

WIA @ 0x00

WIA [7:0]

Options

  • 72 = Device ID

Device ID of AKM. It is described in one byte and fixed value (0×48).

[0x01] INFO

Information (INFO @ 0x01)

Register Bitfields

  • [7:0] INFO
RO[7:0] INFO

INFO @ 0x01

INFO [7:0]

Device information for AKM.

[0x02] ST1

Status 1 (ST1 @ 0x02)

Register Bitfields

  • [0] DRDY - Data Ready
RO [0] DRDY

ST1 @ 0x02

Data Ready (DRDY [0])

DRDY bit turns to “1” when data is ready in single measurement mode or self-test mode. It returns to “0” when any one of ST2 register or measurement data register (HXL to HZH) is read.

[0x03] HXL

X-axis measurement lower byte (HXL @ 0x03)

Register Bitfields

  • [15:0] HX - X-axis measurement
RO[15:0] HX

HXL @ 0x03

X-axis measurement (HX [15:0])

Measurement data is stored in two’s complement and Little Endian format. Measurement range of each axis is from -4096 to +4095 in decimal.

[0x04] HXH

X-axis measurement upper byte (HXH @ 0x04)

RO
[0x05] HYL

Y-axis measurement lower byte (HYL @ 0x05)

Register Bitfields

  • [15:0] HY - Y-axis measurement
RO[15:0] HY

HYL @ 0x05

Y-axis measurement (HY [15:0])

Measurement data is stored in two’s complement and Little Endian format. Measurement range of each axis is from -4096 to +4095 in decimal.

[0x06] HYH

Y-axis measurement upper byte (HYH @ 0x06)

RO
[0x07] HZL

Z-axis measurement lower byte (HZL @ 0x07)

Register Bitfields

  • [15:0] HZ - Z-axis measurement
RO[15:0] HZ

HZL @ 0x07

Z-axis measurement (HZ [15:0])

Measurement data is stored in two’s complement and Little Endian format. Measurement range of each axis is from -4096 to +4095 in decimal.

[0x08] HZH

Y-axis measurement upper byte (HZH @ 0x08)

RO
[0x09] ST2

Status 2 (ST2 @ 0x09)

Register Bitfields

  • [3] HOFL - Magnetic sensor overflow
  • [2] DERR - Data Error
RO [3] HOFL

ST2 @ 0x09

Magnetic sensor overflow (HOFL [3])

In single measurement mode and self-test mode, magnetic sensor may overflow even though measurement data regiseter is not saturated. In this case, measurement data is not correct and HOFL bit turns to “1”. When next measurement stars, it returns to “0”. Refer to 6.4.2.3 for detailed information.

[2] DERR

ST2 @ 0x09

Data Error (DERR [2])

When data reading is started out of data readable period, the read data are not correct. In this case, data read error occurs and DERR bit turns to “1”. When ST2 register is read, it returns to “0”.

 
[0x0A] CNTL

Control (CNTL @ 0x0A)

Register Bitfields

  • [3:0] MODE - Operation mode setting
R/W [3:0] MODE

CNTL @ 0x0A

Operation mode setting (MODE [3:0])

Options

  • 0 = Power-down
  • 1 = Single measurement
  • 8 = Self-test
  • 15 = Fuse ROM access

MODE[3:0]: Operation mode setting

“0000”: Power-down mode
“0001”: Single measurement mode
“1000”: Self-test mode
“1111”: Fuse ROM access mode

Other code settings are prohibited.

When each mode is set, AK8975/B transits to set mode. Refer to 6.3 for detailed information. When CNTL register is accessed to be written, registers from 02H to 09H are initialized.

[0x0B] RSV

Reserved (RSV @ 0x0B)

RSV register is reserved. Do not use this register.

R/W 
[0x0C] ASTC

Self Test Control (ASTC @ 0x0C)

Register Bitfields

  • [6] SELF - Self Test Control

NOTE: Do not write “1” to any bit other than SELF bit in ASTC register. If “1” is written to any bit other than SELF bit, normal measurement can not be done.

R/W [6] SELF

ASTC @ 0x0C

Self Test Control (SELF [6])

Write “0” for Normal mode (no self test), or “1” to generate magnetic field for self-test.

 
[0x0D] TS1

Test 1 (TS1 @ 0x0D)

TS1 is a test register for shipment test. Do not use this register.

R/W 
[0x0E] TS2

Test 2 (TS2 @ 0x0E)

TS2 is a test register for shipment test. Do not use this register.

R/W 
[0x0F] I2CDIS

I2C Disable (I2CDIS @ 0x0F)

Register Bitfields

  • [0] I2CDIS - I2C Disable

This register disables I2C bus interface. I2C bus interface is enabled in default. To disable I2C, write “00011011” to I2CDIS register. Then I2CDIS bit turns to “1” and I2C bus interface is disabled.

Once I2CDIS is turned to “1” and I2C bus interface is disabled, re-setting I2CDIST to “0” is prohibited. To enable I2C bus interface, reset AK8975/B by turning VDD or VID to OFF (0V) once.

R/W [0] I2CDIS

I2CDIS @ 0x0F

I2C Disable (I2CDIS [0])

Then I2CDIS bit turns to “1” and I2C bus interface is disabled.

[0x10] ASAX

X-axis sensitivity adjustment (ASAX @ 0x10)

Register Bitfields

  • [7:0] COEFX - Magnetic sensor X-axis sensitivity adjustment data

Sensitivity adjustment data for each axis is stored to fuse ROM on shipment.

RO[7:0] COEFX

ASAX @ 0x10

Magnetic sensor X-axis sensitivity adjustment data (COEFX [7:0])

[0x11] ASAY

Y-axis sensitivity adjustment (ASAY @ 0x11)

Register Bitfields

  • [7:0] COEFY - Magnetic sensor Y-axis sensitivity adjustment data

Sensitivity adjustment data for each axis is stored to fuse ROM on shipment.

RO[7:0] COEFY

ASAY @ 0x11

Magnetic sensor Y-axis sensitivity adjustment data (COEFY [7:0])

[0x12] ASAZ

Z-axis sensitivity adjustment (ASAZ @ 0x12)

Register Bitfields

  • [7:0] COEFZ - Magnetic sensor Z-axis sensitivity adjustment data

Sensitivity adjustment data for each axis is stored to fuse ROM on shipment.

RO[7:0] COEFZ

ASAZ @ 0x12

Magnetic sensor Z-axis sensitivity adjustment data (COEFZ [7:0])