ASAHI KASEI [AK8973] =Preliminary= AK8973 3-axis Electronic Compass 1. Features 3-axis electronic compass IC Optimal built-in electronic compass for mobile phones and handy terminals High sensitivity Hall sensors are integrated. Functions • Built-in 8-bit ADC • Built-in amplifier for sensor signal amplification • Built-in 8-bit DAC for sensor signal offset compensation • Built-in EEPROM for storing individual adjustment values • Built-in temperature sensor • 8-bit digital output • Serial interface: I2C bus interface (supporting the low-voltage specification) • Automatic power-down function • Interrupt function for measurement data ready • Built-in master clock oscillator Operating temperatures: Operating supply voltage: +2.5V to +3.6V Low current consumption/measurement time: • Power-down: 0.2μA typ. • Magnetic sensor driving: 6.8mA/12.6ms Package: 16-pin QFN package: MS0561-E-01 <Preliminary> -30°C to +85°C 4.0mm×4.0mm×0.7mm -1- 2007/01 ASAHI KASEI [AK8973] 2. Overview AK8973 is a geomagnetism detection type electronic compass IC. The small package of AK8973 integrates magnetic sensors for detecting geomagnetism in the X-axis, Y-axis, and Z-axis, and arithmetic circuit for processing the signal from each sensor. AK8973 outputs four data in total as 8-bit digital values respectively: 3-axis magnetic sensor measured values and temperature sensor read value. By processing the magnetic sensor measured values with an external CPU, azimuth data can be obtained. By using AK8973 integrated into the system, a navigation system is achieved with reduced space in portable equipment such as PDA or mobile phone incorporating the GPS function. Specifically, AK8973 has the following features: (1) Due to the built-in 8-bit ADC and serial interface, geomagnetism of the X-axis, Y-axis, and Z-axis can be detected as digital data. (2) The serial interface corresponds to the I2C bus. (3) A dedicated power supply is used for the serial interface, so the low-voltage specification can also be supported by applying 1.85V. (4) Due to the built-in DAC for compensating the offset magnetic field, the position restraint with parts which generate the offset magnetic field such as speakers is reduced, and the degree of freedom about layout is expanded. Note 1) (5) An EEPROM for storing the individual adjustment values of sensor sensitivity is built-in. The adjustment values are stored in factory at the time of shipment from AKM. (6) The built-in temperature sensor as an accessory generates the 8-bit digital A/D-converted value. The temperature information is not used for azimuth calculation. (7) The major circuit blocks of AK8973 are activated by the measurement request command from the controller, and transit to the power-down mode automatically at the end of measurement. That characteristic realizes the low power consumption required for mobile phones. (8) The interrupt function for posting the completion of sensor signal measurement to the external CPU is built-in. (9) The master clock oscillator is built-in. It is unnecessary to supply the clock from the outside. Note 1) For AK8973, the offset magnetic field compensation range is approximately ±2.0mT (typical geomagnetism range is approximately 0.05mT). Depending on usage or required accuracy, use with the full-range is available. However, for the azimuth measurement by the mobile phones, it is important to regard the following in the design phase: the magnetic field intensity of offset magnetic field source (e.g. magnet of speaker) is not fully controlled, and the temperature characteristic dispersion is noted. With AK8973, it is recommended that the design be performed with the parts layout where the offset magnetic field of each measurement axis is ±0.8mT or less. MS0561-E-01 <Preliminary> -2- 2007/01 ASAHI KASEI [AK8973] 3. Table of Contents 1. 2. 3. 4. Features ....................................................................................................................................1 Overview ...................................................................................................................................2 Table of Contents ......................................................................................................................3 Circuit Configuration ..................................................................................................................5 4.1. Block Diagram....................................................................................................................5 4.2. Block Function....................................................................................................................6 4.3. Pin Function .......................................................................................................................7 5. Overall Characteristics ..............................................................................................................8 5.1. Absolute Maximum Ratings................................................................................................8 5.2. Recommended Operating Conditions ................................................................................8 5.3. Electrical Characteristics ....................................................................................................8 5.3.1. DC Characteristics ......................................................................................................8 5.3.2. EEPROM Characteristics............................................................................................9 5.3.3. Analog Circuit Characteristics .....................................................................................9 5.4. Detailed Timing...................................................................................................................9 5.4.1. Various Timing.............................................................................................................9 5.4.2. I2C Bus Interface .......................................................................................................10 6. Functional Explanation ............................................................................................................ 11 6.1. Operation Modes.............................................................................................................. 11 6.2. Description of Each Operation Mode................................................................................12 6.2.1. Power-down Mode ....................................................................................................12 6.2.2. Sensor Measurement Mode ......................................................................................12 6.2.3. EEPROM Mode.........................................................................................................13 6.3. Interrupt Function based on INT Pin.................................................................................13 7. Serial Interface ........................................................................................................................14 7.1. Data Transfer....................................................................................................................14 7.1.1. Change of Data .........................................................................................................14 7.1.2. Start/Stop Condition ..................................................................................................14 7.1.3. Acknowledge.............................................................................................................15 7.1.4. Slave Address ...........................................................................................................15 7.2. WRITE Instruction ............................................................................................................16 7.3. READ Instruction..............................................................................................................17 7.3.1. Current Address READ .............................................................................................17 7.3.2. Random READ..........................................................................................................17 8. Registers .................................................................................................................................18 8.1. Description of Registers ...................................................................................................18 8.2. Register Map....................................................................................................................19 8.3. Detailed Description of Registers .....................................................................................20 8.3.1. ST: Status Register....................................................................................................20 8.3.2. TMPS: Temperature Sensor Data Register ...............................................................20 8.3.3. H1X, H1Y, H1Z: Sensor Data Register......................................................................21 8.3.4. MS1: Mode Setting Register 1 ..................................................................................21 8.3.5. HXDA, HYDA, HZDA: Magnetic Sensor DAC Setting Register.................................22 8.3.6. HXGA, HYGA, HZGA: Magnetic Sensor Gain Setting Register ................................23 9. EEPROM.................................................................................................................................24 9.1. Outline of the Function .....................................................................................................24 9.2. Operation Description.......................................................................................................25 9.2.1. READ Instruction.......................................................................................................25 9.2.1.1. Current Address READ ......................................................................................25 9.2.1.2. Random READ ..................................................................................................25 9.2.2. WRITE Instruction .....................................................................................................26 9.2.2.1. Byte-Write ..........................................................................................................26 9.3. Memory Map ....................................................................................................................27 10. Example of Recommended External Connection ....................................................................28 11. Package ..................................................................................................................................29 11.1. Marking ............................................................................................................................29 11.2. Pin Assignment ................................................................................................................29 MS0561-E-01 <Preliminary> -3- 2007/01 ASAHI KASEI [AK8973] 11.3. Outline Dimensions ..........................................................................................................30 11.4. Recommended Foot Print Pattern ....................................................................................30 12. Relationship between the Magnetic Field and Output Code....................................................31 MS0561-E-01 <Preliminary> -4- 2007/01 ASAHI KASEI [AK8973] 4. Circuit Configuration 4.1. Block Diagram HE-X Chopper SW Integrator Pre-AMP ADC S&H MUX HE-Y HE-Z DAC SCL T-sensor SDA HE-Drive Interface Logic &Register OSC CAD1 CAD0 RSTN INT Timing Logic Voltage Reference TST1 MS0561-E-01 <Preliminary> TST2 -5- TST3 EEPROM VSS VID VDD 2007/01 ASAHI KASEI 4.2. [AK8973] Block Function Block HE-X, Y, Z MUX Chopper SW HE-Drive Pre-AMP DAC Integrator S&H ADC T-sensor OSC Interface Logic & Register Timing Logic EEPROM Function High sensitivity sensors included in the package Multiplexer for selecting one axis from the 3-axis magnetic sensor Performs chopping. Magnetic sensor drive circuit for constant-current driving of sensor Variable-gain differential amplifier used to amplify a magnetic sensor signal and to adjust sensitivity. Gain setting: 26.8dB min., increased in 0.4dB/step, 16 steps (4 bits) DAC for offset voltage compensation. Resolution: 8 bits Integrates and amplifies the Pre-AMP output signal. Sample-and-hold circuit Performs analog-to-digital conversion for the signal of each sensor. Resolution: 8 bits Temperature sensor: Outputs the voltage proportional to the temperature. Built-in oscillator Automatically oscillates the operation clock in the sensor measurement mode. Exchanges data with the external CPU. I2C bus interface using two pins, namely, SCL and SDA. Using two pins of CAD0 and CAD1, lower 2-bit of slave address can be specified. Completion of sensor signal measurement is posted to the external CPU via INT pin. The low-voltage specification can be supported by applying 1.85V to the VID pin. Generates a timing signal required for internal operation based on the OSC generated clock. Nonvolatile memory. Stores initial adjustment values of each sensor at the time of shipment from AKM. The I2C bus interface is supported. Accessible through the two pins of SCL and SDA. Do not write to the EEPROM in ordinary use. MS0561-E-01 <Preliminary> -6- 2007/01 ASAHI KASEI 4.3. [AK8973] Pin Function Power supply system VID VID No. Pin name I/O 1 2 3 CAD0 CAD1 VID I I - 4 SDA I/O VID CMOS 5 SCL I VID CMOS 6 TST1 I/O - Analog 7 INT O VID CMOS 8 RSTN I VID CMOS 9 NC1 - - - 10 11 TST2 TST3 I/O I/O - Analog Analog 12 13 14 NC2 NC3 NC4 - - - 15 16 VDD VSS - MS0561-E-01 <Preliminary> Type Function CMOS CMOS POWER Slave address 0 input pin Slave address 1 input pin Digital interface positive power supply pin. This pin is a positive power supply pin for the digital interface block. By connecting this pin to a 1.85V power supply, the low-voltage specification digital interface can be connected. Control data input/output pin Input: Schmidt trigger, Output: Open drain Control data clock input pin Input: Schmidt trigger Test pin In usual use, eliminate unnecessary wiring, separate this pin from other test pins, and keep this pin electrically nonconnected. Interrupt signal output pin This pin is used to post the measurement completion to the external CPU. Refer to 6.3. Reset pin This pin resets all the register values when "L" is applied. After turning the power on, be sure to apply "L". Nonconnected pin In usual use, eliminate unnecessary wiring, separate this pin from other test pins, and keep this pin electrically nonconnected. Test pin In usual use, eliminate unnecessary wiring, separate this pin from other test pins, and keep this pin electrically nonconnected. Nonconnected pin In usual use, eliminate unnecessary wiring, separate this pin from other test pins, and keep this pin electrically nonconnected. Power supply pin Ground pin POWER POWER -7- 2007/01 ASAHI KASEI [AK8973] 5. Overall Characteristics 5.1. Absolute Maximum Ratings VSS=0V Parameter Symbol Min. Max. Unit V+ -0.3 +6.5 Power supply voltage V (VDD, VID) VIN -0.3 (V+)+0.3 Input voltage V IIN Input current mA ±10 TST -40 +85 Storage temperature °C Note If the device is used in conditions exceeding these values, the device may be destroyed. Normal operations and EEPROM data are not guaranteed in such exceeding conditions. 5.2. Recommended Operating Conditions VSS=0V Parameter Remark Symbol Min. Typ. Ta -30 Operating temperature VDD 2.5 3.0 Power supply VDD pin voltage VID pin voltage VID 1.70 1.85 voltage Note When turning on/off the power, turn on/off VDD and VID at the same time. . 5.3. Max. +85 Unit °C 3.6 VDD V V Electrical Characteristics The following conditions apply unless otherwise noted: VDD=2.5V to 3.6V, VID=1.7V to VDD, Temperature range=-30°C to 85°C 5.3.1. DC Characteristics Parameter High level input voltage 1 Symbol VIH1 Low level input voltage 1 VIL1 High level input voltage 2 Low level input voltage 2 VIH2 VIL2 IIN Input current (Note 1) Hysteresis input voltage (Note 2) VHS High level output voltage 1 Low level output voltage 1 Low level output voltage 2 VOH1 VOL1 VOL2 (Note 3)(Note 4) Current consumption IDD1 Pin SCL SDA CAD0 CAD1 RSTN SCL SDA CAD0 CAD1 RSTN SCL SDA INT SDA Condition Min. 70%VID Typ. Max. Unit V 30%VID V 20%VID +10 V V μA 0.2 0.4 0.4 20%VID 5 V V V V V V μA 80%VID Vin=VSS or VID VID≥2V VID<2V IOH=-200µA (Note 5) IOL=+200µA (Note 5) IOL=3mA VID≥2V IOL=3mA VID<2V In power-down mode -10 5%VID 10%VID 90%VID IDD2 When magnetic sensor is driven 6.8 10.2 mA IDD3 Average when reading with 100ms 0.8 1.2 mA (Note 1) Maximum input pin capacitance: 10pF (reference value for design) (Note 2) Applied to the SCL pin and SDA pin (Schmitt trigger input) (reference value for design) (Note 3) Maximum load capacitance: 400pF (capacitive load of each bus line applied to the I2C bus interface) (Note 4) Output is open-drain output. Connect a pull-up resistor externally. (Note 5) Load capacitance: 20pF MS0561-E-01 <Preliminary> -8- 2007/01 ASAHI KASEI [AK8973] 5.3.2. EEPROM Characteristics Parameter EEPROM erase/write cycles EEPROM data retention * For write operation, VDD of 2.9V or more is required. Min. 1000 10 (85°C) Max. Unit Cycles Years 5.3.3. Analog Circuit Characteristics Parameter Symbol Condition Min. Typ. Max. Unit TRS 100 ns From rising edge of power RSTN rise timing source (VDD, VID) until RSTN rising edge TSM Sum of Ttm+Thm 10.0 12.6 15.1 ms Time for measurement (Refer to 6.2.2) ASR 8 bit ADC resolution DRS 8 bit DAC resolution DAC step width DST VDD=3.0V 124 156 187 μV LSB DAC accuracy DAQ VDD=3.0V ±1/8 Pre-AMP gain setting range VDD=3.0V Lower limit HASL Gain setting register: 0H 26.3 26.8 27.3 dB Upper limit HASH Gain setting register: FH 32.3 32.8 33.3 dB (Note 6) AGS 0.25 0.4 0.55 dB Pre-AMP gain step width TOP -30 85 Temperature sensor °C measurement range TOC 71H 78H 7FH code VDD=3.0V, Tc=35°C Temperature sensor output code TSE VDD=3.0V(Note 7) -1.4 -1.6 -1.8 LSB/°C Temperature sensor sensitivity BSE 420 600 780 LSB VDD=2.5V Tc=25°C Magnetic sensor sensitivity B= 300mT, Differential signal ± (Note 8) HXGA=HYGA=07H、 HZGA=0AH (Note 6) Gain setting register of each axis of magnetic sensor. HXGA, HYGA, HZGA.(Refer to 8.3.6.) (Note 7) Reference value for design (Note 8) Set the data of EHXGA, EHYGA, EHZGA into HXGA, HYGA, HZGA respectively. The adjustment value of the pre-AMP gain that becomes 1uT/1LSB is written in low 4bit of EHXGA, EHYGA, and EHZGA. Higher 4bit of HXGA, HYGA, and HZGA is disregarded even if written. Please copy 8bit data read from EHXGA, EHYGA, and EHZGA to HXGA, HYGA, and HZGA as it is. 5.4. Detailed Timing 5.4.1. Various Timing Parameter Wait time before mode setting RSTN Pulse Width EEPROM access mode turn on time EEPROM programming time MS0561-E-01 <Preliminary> Symbol Twat Trnw Condition Min. 100 100 Typ. 300 Twr 10 -9- Max. Unit μs ns μs ms 2007/01 ASAHI KASEI [AK8973] 5.4.2. I2C Bus Interface (1) Standard mode at 1.7V≤VID≤VDD Symbol Parameter fSCL SCL clock frequency tHIGH SCL clock "High" time tLOW SCL clock "Low" time tR SDA and SCL rise time tF SDA and SCL fall time tHD:STA Start Condition hold time tSU:STA Start Condition setup time tHD:DAT SDA hold time (vs. SCL falling edge) tSU:DAT SDA setup time (vs. SCL rising edge) tSU:STO Stop Condition setup time tBUF Bus free time Min. Typ. Max. 100 Unit kHz μs μs μs μs μs μs μs ns μs μs 4.0 4.7 1.0 0.3 4.0 4.7 0 250 4.0 4.7 (2) Fast mode at 1.7V≤VID≤VDD Symbol Parameter fSCL SCL clock frequency tHIGH SCL clock "High" time tLOW SCL clock "Low" time tR SDA and SCL rise time tF SDA and SCL fall time tHD:STA Start Condition hold time tSU:STA Start Condition setup time tHD:DAT SDA hold time (vs. SCL falling edge) tSU:DAT SDA setup time (vs. SCL rising edge) tSU:STO Stop Condition setup time tBUF Bus free time tSP Noise suppression pulse width Min. Typ. Max. 400 Unit kHz μs μs μs μs μs μs μs ns μs μs ns 0.6 1.3 0.3 0.3 0.6 0.6 0 100 0.6 1.3 50 [I2C bus interface timing] 1/fSCL VIH1 SCL VIL1 VIH1 SDA VIL1 tLOW tBUF tR tHIGH tF tSP VIH1 SCL VIL1 tHD:STA Stop tHD:DAT tSU:DAT tSU:STA tSU:STO Start Stop Start MS0561-E-01 <Preliminary> - 10 - 2007/01 ASAHI KASEI [AK8973] 6. Functional Explanation 6.1. Operation Modes AK8973 has following three operation modes: (1) Power-down mode (2) Sensor measurement mode (3) EEPROM access mode By setting MS1 register MODE[1:0] bits, the operation set for each mode is started. A transition from one mode to another is shown below. 1) Power input VDD 2) Resetting with RSTN pin MODE[1:0]=00 (1) Power-down mode Set measurement condition. (2) Sensor measurement mode MODE[1:0]=11 (normal operation) On measurement completion, transitons to the power-down mode automatically. MODE[1:0]=10 (3) EEPROM access mode MODE[1:0]=11 After turning on the power, perform a reset operation by applying "L" to RSTN pin. Then AK8973 is set to power-down mode. A transition to mode (2) or (3) can be made only from power-down mode. A transition to a mode (2) or (3) must be made through the power-down mode. To make the mode transition, write the setting data into the MODE[1:0] shown in the transition diagram. After power-down mode is set, at least 100μs(Twat) is needed before setting another mode. Be sure to write a measurement condition for sensor measurement mode during the power-down mode. Write-only registers MS1 and read-only registers can be accessed in any of the modes above. MS0561-E-01 <Preliminary> - 11 - 2007/01 ASAHI KASEI 6.2. [AK8973] Description of Each Operation Mode 6.2.1. Power-down Mode Power to all internal circuits is turned off. During power-down mode, measurement conditions for sensor measurement mode can be set by setting adequate values to the registers. The measurement conditions set in the registers are reset only by applying "L" signal to RSTN pin, and not by a mode transition. 6.2.2. Sensor Measurement Mode Measurement is made with the sequence below. When the measurement is completed, it transits to power-down mode automatically. <Timing Chart> Measurement timing Ttm T Thm Power-down mode I/F-logic Ttm H Write sensor measurement mode T Thm H Power-down mode Power-down mode Write sensor measurement mode INT bit INT bit Measured data read Measured data read Be sure to read measured data before starting the next measurement. Ttm: Temperature sensor measurement period, Thm: Magnetic sensor measurement period TSM: Ttm+Thm=12.56ms typ. <Detailed Description> When sensor measurement mode (MODE[1:0]="00") is set to register at power-down mode, AK8973 starts measurement operation. First, temperature sensor and 3-axis magnetic sensor are measured in sequence, automatically. Then, the measured data are stored in the following registers. Finally, AK8973 automatically transits to power-down mode. Temperature sensor output result Register TMPS[7:0] Magnetic sensor output result Register H1X[7:0], H1Y[7:0], H1Z[7:0] When AK8973 returns to power-down mode, INT pin is driven to "H" to notify the external CPU that the measurements have been finished. INT bit is placed in the same state. When sensor output results are read, INT pin is driven to "L". For the fall timing of INT pin, refer to "6.3. Interrupt Function based on INT Pin". On the falling edge of INT pin, INT bit also returns to "0". When the external CPU confirmed that INT pin is driven to "H" or INT bit is set to "1", it should recognize that the sensor measurements are completed, and then read the mentioned 4-byte data of sensor output results. <Note> To execute the sensor measurement mode, INT pin must be "L" or INT bit must be "0". Before executing this pattern, check that INT pin is "L" or INT bit is "0", or drive INT pin to "L" by performing data register read operation as dummy. An attempt to set the sensor measurement mode when the INT pin is high is ignored. Also when the transition of power-down mode is set to the sensor measurement mode or EEPROM access mode, the contents of magnetic sensor output results of H1X[7:0], H1Y[7:0], and H1Z[7:0] are reset. MS0561-E-01 <Preliminary> - 12 - 2007/01 ASAHI KASEI [AK8973] 6.2.3. EEPROM Mode This mode is used to access the EEPROM. In ordinary use, read operation is needed, but write operation must not be performed. To the EEPROM, the correction values of sensors are written before shipment from AKM. If these correction values are lost, AK8973 cannot perform operations and measurements normally. For details, refer to "9. EEPROM". 6.3. Interrupt Function based on INT Pin AK8973 has an interrupt function for notifying the external CPU of completion of sensor signal measurement by transition of INT pin from "L" to "H". INT pin returns to "L" when any of the registers storing temperature or magnetic sensor output result is read. On the falling edge of INT pin, INT bit also returns to "0". In case of current address read, whether any of the registers mentioned above is read is checked. If any of them is read, INT pin returns to "L" at the timing shown below. S T A R T SDA S S T O P R/W="1" Slave Address Data(n) A C K Data(n+1) A C K Data(n+x) Data(n+2) A C K A C K A C K P A C K INT In case of random read, if the specified address is any of the registers mentioned above, INT pin returns to "L" at the timing shown below. S T A R T SDA S S T A R T R/W="0" Slave Address Register Address(n) A C K S A C K S T O P R/W="1" Data(n) Slave Address A C K Data(n+x) Data(n+1) A C K A C K A C K P A C K INT MS0561-E-01 <Preliminary> - 13 - 2007/01 ASAHI KASEI [AK8973] 7. Serial Interface The I2C bus interface of AK8973 supports the standard mode (100kHz max.) and the Fast mode (400kHz max.). Both modes can be operable in 1.7V≤VID≤VDD. 7.1. Data Transfer To access the AK8973 on the bus, generate a start condition first. Next, transmit a one-byte slave address including a device address. At this time, AK8973 compares the slave address with its own address. If these addresses match, AK8973 generates an acknowledgement, and then executes READ or WRITE instruction. At the end of instruction execution, generate a stop condition. 7.1.1. Change of Data A change of data on the SDA line must be made during "Low" period of the clock on the SCL line. When the clock signal on the SCL line is "High", the state of the SDA line must be stable. (Data on the SDA line can be changed only when the clock signal on the SCL line is "Low".) During the SCL line is "High", the state of data on the SDA line is changed only when a start condition or a stop condition is generated. SCL SDA DATA LINE STABLE : DATA VALID CHANGE OF DATA ALLOWED Fig. 01 Data Change 7.1.2. Start/Stop Condition If the SDA line is driven to "Low" from "High" when the SCL line is "High", a start condition is generated. Any instruction starts with a start condition. If the SDA line is driven to "High" from "Low" when the SCL line is "High", a stop condition is generated. Any instruction stops with a stop condition. SCL SDA START CONDITION STOP CONDITION Fig. 02 START and STOP conditions MS0561-E-01 <Preliminary> - 14 - 2007/01 ASAHI KASEI [AK8973] 7.1.3. Acknowledge The IC that is transmitting data releases the SDA line (in the "High" state) after sending 1-byte data. The IC that receives the data drives the SDA line to "Low" on the next clock pulse. This operation is referred to acknowledge. With this operation, whether data has been transferred successfully can be checked. AK8973 generates an acknowledge after reception of a start condition and slave address. When a WRITE instruction is executed, AK8973 generates an acknowledge after every byte is received. When a READ instruction is executed, AK8973 generates an acknowledge then transfers the data stored at the specified address. Next, AK8973 releases the SDA line then monitors the SDA line. If a master IC generates an acknowledge instead of a stop condition, AK8973 transmits the 8bit data stored at the next address. If no acknowledge is generated, AK8973 stops data transmission. Clock pulse for acknowledge SCL FROM MASTER 1 8 9 DATA OUTPUT BY TRANSMITTER not acknowledge DATA OUTPUT BY RECEIVER START CONDITION acknowledge Fig. 03 Generation of Acknowledge 7.1.4. Slave Address The first byte including a slave address is transmitted after a start condition, and an IC to be accessed is selected from the ICs on the bus according to the slave address. A slave address of AK8973 consists of 7 bits. The most significant 5 bits are fixed to "00111". The next 2 bits are address bits used to select an IC to be accessed, and are set by the CAD1-0 pins. When a slave address is transferred, the IC whose device address matches the transferred slave address generates an acknowledge then executes an instruction. The 8th bit (least significant bit) of the first byte is a R/W bit. When the R/W bit is set to "1", READ instruction is executed. When the R/W bit is set to "0", WRITE instruction is executed. MSB 0 LSB 0 1 1 1 CAD1 CAD0 R/W Fig. 04 Slave Address MS0561-E-01 <Preliminary> - 15 - 2007/01 ASAHI KASEI 7.2. [AK8973] WRITE Instruction When the R/W bit is set to "0", AK8973 performs write operation. In write operation, AK8973 generates an acknowledge after receiving a start condition and the first byte (slave address) then receives the second byte. The second byte is used to specify the address of an internal control register and is based on the MSB-first configuration. MSB A7 LSB A6 A5 A4 A3 A2 A1 A0 Fig. 05 Register Address After receiving the second byte (register address), AK8973 generates an acknowledge then receives the third byte. The third byte and after represent control data. Control data consists of 8 bits and is based on the MSB-first configuration. AK8973 generates an acknowledge after every byte is received. Data transfer always stops with a stop condition generated by the master. MSB D7 LSB D6 D5 D4 D3 D2 D1 D0 Fig. 06 Control Data AK8973 can write multiple bytes of data at a time. After reception of the third byte (control data), AK8973 generates an acknowledge then receives the next data. If additional data is received instead of a stop condition after receiving one byte of data, the address counter inside the LSI chip is automatically incremented and the data is written at the next address. If the writing of data starts at address "E0H", the write address changes from "E0H, E1H through E5H, E6H". When "E6H" is exceeded, the internal address counter rolls over, and the following data is written in sequentially starting at address "E0H" again. S T A R T SDA S S T O P R/W="0" Slave Address Data(n) Register Address(n) A C K A C K Data(n+x) Data(n+1) A C K A C K A C K P A C K Fig. 07 WRITE Operation MS0561-E-01 <Preliminary> - 16 - 2007/01 ASAHI KASEI 7.3. [AK8973] READ Instruction When the R/W bit is set to "1", AK8973 performs read operation. If a master IC generates an acknowledge instead of a stop condition after AK8973 transfers the data at a specified address, the data at the next address can be read. If the reading of data starts from "C0H, C1H through C3H, C4H" or "E0H, E1H through E5H, E6H", and additional data is read after reading, the internal address counter rolls over and the data at "C0H" or "E0H" is read again. AK8973 supports current address read and random read. 7.3.1. Current Address READ AK8973 has an address counter inside the LSI chip. In current address read operation, the data at an address specified by this counter is read. The internal address counter holds the next address of the most recently accessed address. For example, if the address most recently accessed (for READ instruction) is address "n", and a current address read operation is attempted, the data at address "n+1" is read. In current address read operation, AK8973 generates an acknowledge after receiving a slave address for the READ instruction (R/W bit="1"). Next, AK8973 transfers the data specified by the internal address counter starting with the next clock pulse, then increments the internal counter by one. If the master IC generates a stop condition instead of an acknowledge after AK8973 transmits one byte of data, the read operation stops. S T A R T SDA S S T O P R/W="1" Slave Address Data(n) A C K Data(n+1) A C K Data(n+2) A C K Data(n+x) A C K A C K P A C K Fig. 08 CURRENT ADDRESS READ 7.3.2. Random READ By random read operation, data at an arbitrary address can be read. Random read operation requires to execute WRITE instruction as dummy before a slave address for the READ instruction (R/W bit="1") is transmitted. In random read operation, a start condition is first generated then a slave address for the WRITE instruction (R/W bit="0") and a read address are transmitted sequentially. After AK8973 generates an acknowledge in response to this address transmission, a start condition and a slave address for the READ instruction (R/W bit="1") are generated again. AK8973 generates an acknowledge in response to this slave address transmission. Next, AK8973 transfers the data at the specified address then increments the internal address counter by one. If the master IC generates a stop condition instead of an acknowledge after data is transferred, the read operation stops. S T A R T SDA S S T A R T R/W="0" Register Address(n) Slave Address A C K S A C K S T O P R/W="1" Data(n) Slave Address A C K Data(n+1) A C K Data(n+x) A C K A C K P A C K Fig. 09 RANDOM READ MS0561-E-01 <Preliminary> - 17 - 2007/01 ASAHI KASEI [AK8973] 8. Registers 8.1. Description of Registers AK8973 has registers of 13 addresses as indicated in Table 1. Every address consists of 8 bits data. Data is transferred to or received from the external CPU via the serial interface described previously. ST C0H READ/ WRITE READ TMPS C1H READ H1X H1Y H1Z MS1 C2H C3H C4H E0H READ HXDA E1H HYDA E2H HZDA E3H HXGA E4H HYGA E5H HZGA E6H READ/ WRITE TS1 5DH READ/ WRITE Name Address Description Status register Temperature sensor data register Magnetic sensor data register READ/ WRITE Mode setting register READ/ WRITE READ/ WRITE Magnetic sensor X-axis DAC setting register Magnetic sensor Y-axis DAC setting register Magnetic sensor Z-axis DAC setting register Magnetic sensor X-axis gain setting register Magnetic sensor Y-axis gain setting register Magnetic sensor Z-axis gain setting register Test mode setting register READ/ WRITE READ/ WRITE READ/ WRITE Explanation Interrupt EEPROM write enabled/disabled Temperature sensor data read X-axis data read Y-axis data read Z-axis data read Operation mode setting EEPROM write enable/disable setting X-axis offset DAC setting value Y-axis offset DAC setting value Z-axis offset DAC setting value X-axis AMP gain setting value Y-axis AMP gain setting value Z-axis AMP gain setting value Not to be used by the user. Used for testing before shipment Table 1 MS0561-E-01 <Preliminary> - 18 - 2007/01 ASAHI KASEI 8.2. [AK8973] Register Map Register Name Addr Read-only Register C0H ST C1H TMPS C2H H1X C3H H1Y C4H H1Z Write/read register E0H MS1 E1H HXDA E2H HYDA E3H HZDA E4H HXGA E5H HYGA E6H HZGA 5DH TS1 D7 D6 D5 D4 D3 D2 D1 D0 0 TMPS7 H1X7 H1Y7 H1Z7 0 TMPS6 H1X6 H1Y6 H1Z6 0 TMPS5 H1X5 H1Y5 H1Z5 0 TMPS4 H1X4 H1Y4 H1Z4 0 TMPS3 H1X3 H1Y3 H1Z3 0 TMPS2 H1X2 H1Y2 H1Z2 WEN TMPS1 H1X1 H1Y1 H1Z1 INT TMPS0 H1X0 H1Y0 H1Z0 WEN4 WEN3 WEN2 WEN1 WEN0 0 MODE1 HXDA7 HXDA6 HXDA5 HXDA4 HXDA3 HXDA2 HXDA1 HYDA7 HYDA6 HYDA5 HYDA4 HYDA3 HYDA2 HYDA1 HZDA7 HZDA6 HZDA5 HZDA4 HZDA3 HZDA2 HZDA1 0 0 0 0 HXGA3 HXGA2 HXGA1 0 0 0 0 HYGA3 HYGA2 HYGA1 0 0 0 0 HZGA3 HZGA2 HZGA1 - MODE0 HXDA0 HYDA0 HZDA0 HXGA0 HYGA0 HZGA0 - When the RSTN pin is driven to "L", all registers of AK8973 are initialized, resulting in power-down mode. During sensor measurement mode, only MS1 register can be written in. Do not write in the registers other than MS1. TS1 is test mode setting addresses for testing before shipment. Do not use TS1. Otherwise, the operation error may result. MS0561-E-01 <Preliminary> - 19 - 2007/01 ASAHI KASEI 8.3. [AK8973] Detailed Description of Registers 8.3.1. ST: Status Register Register Addr D7 name Read-only register C0H ST 0 Reset 0 D6 D5 D4 D3 D2 D1 D0 0 0 0 0 0 0 0 0 0 0 WEN 0 INT 0 D3 D2 D1 D0 TMPS3 0 TMPS2 0 TMPS1 0 TMPS0 0 INT: Interrupt flag bit "0": Interrupt reset state "1": Interrupt state (This bit is valid only in sensor measurement mode (not valid in other modes).) WEN: EEPROM write enabled/disabled state check bit "0": Read mode "1": Write mode 8.3.2. TMPS: Temperature Sensor Data Register Register Addr D7 D6 D5 D4 name Read-only register C1H TMPS TMPS7 TMPS6 TMPS5 TMPS4 Reset 0 0 0 0 TMPS[7:0]: Temperature sensor output data Temperature sensor (T-Sensor) converted data 8 bits TMPS code E0H D0H C0H B0H A0H 90H 80H 70H 60H 50H 40H 30H 20H MS0561-E-01 <Preliminary> Temperature [°C] -30 -20 -10 0 10 20 30 40 50 60 70 80 90 Table 2 - 20 - 2007/01 ASAHI KASEI [AK8973] 8.3.3. H1X, H1Y, H1Z: Sensor Data Register Addr Register name D7 D6 D5 Read-only register C2H H1X H1X7 H1X6 H1X5 C3H H1Y H1Y7 H1Y6 H1Y5 C4H H1Z H1Z7 H1Z6 H1Z5 Reset 0 0 0 D4 D3 D2 D1 D0 H1X4 H1Y4 H1Z4 0 H1X3 H1Y3 H1Z3 0 H1X2 H1Y2 H1Z2 0 H1X1 H1Y1 H1Z1 0 H1X0 H1Y0 H1Z0 0 D1 D0 H1X/H1Y/H1Z: Magnetic sensor X-axis/Y-axis/Z-axis output result H1X[7:0]: X-axis output result H1Y[7:0]: Y-axis output result H1Z[7:0]: Z-axis output result Minimum value: 00H Maximum value: FFH 8.3.4. MS1: Mode Setting Register 1 Addr Register name D7 D6 Write/read register E0H MS1 WEN4 WEN3 Reset 0 0 D5 D4 D3 D2 WEN2 0 WEN1 0 WEN0 0 0 0 MODE1 MODE0 1 1 MODE[1:0]: Operation mode setting "00": Sensor measurement mode "01": Setting prohibited "10": EEPROM access mode "11": Power-down mode WEN[4:0]: Setting to enable/disable EEPROM data write "10101": Write mode (write enabled) Other than "10101": Read mode (write disabled) MS0561-E-01 <Preliminary> - 21 - 2007/01 ASAHI KASEI [AK8973] 8.3.5. HXDA, HYDA, HZDA: Magnetic Sensor DAC Setting Register Register Addr D7 D6 D5 D4 D3 D2 D1 D0 name Write/read register E1H HXDA HXDA7 HXDA6 HXDA5 HXDA4 HXDA3 HXDA2 HXDA1 HXDA0 E2H HYDA HYDA7 HYDA6 HYDA5 HYDA4 HYDA3 HYDA2 HYDA1 HYDA0 E3H HZDA HZDA7 HZDA6 HZDA5 HZDA4 HZDA3 HZDA2 HZDA1 HZDA0 Reset 0 0 0 0 0 0 0 0 HXDA[7:0]: Magnetic sensor X-axis offset DAC setting HYDA[7:0]: Magnetic sensor Y-axis offset DAC setting HZDA[7:0]: Magnetic sensor Z-axis offset DAC setting Setting FFH FEH : 81H 80H 00H 01H : 7EH 7FH Set voltage [μV] 156.25μV/step +19843.75 +19687.50 : +156.25 +0 -0 -156.25 : -19687.50 -19843.75 Table 3 [DAC output] + Zero 00H 7FH 80H FFH [ DAC code setting (HXDA, HYDA, HZDA)] MS0561-E-01 <Preliminary> - 22 - 2007/01 ASAHI KASEI [AK8973] 8.3.6. HXGA, HYGA, HZGA: Magnetic Sensor Gain Setting Register Register Addr D7 D6 D5 D4 D3 D2 D1 D0 name Write/read register E4H HXGA 0 0 0 0 HXGA3 HXGA2 HXGA1 HXGA0 E5H HYGA 0 0 0 0 HYGA3 HYGA2 HYGA1 HYGA0 E6H HZGA 0 0 0 0 HZGA3 HZGA2 HZGA1 HZGA0 Reset 0 0 0 0 0 0 0 0 HXGA[3:0]: Magnetic sensor X-axis gain setting HYGA[3:0]: Magnetic sensor Y-axis gain setting HZGA[3:0]: Magnetic sensor Z-axis gain setting Gain setting=(26.8+0.4×N)dB N=0 to 15 Setting 0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH MS0561-E-01 <Preliminary> Gain [dB] 26.8 27.2 27.6 28.0 28.4 28.8 29.2 29.6 30.0 30.4 30.8 31.2 31.6 32.0 32.4 32.8 Table 4 - 23 - 2007/01 ASAHI KASEI [AK8973] 9. EEPROM 9.1. Outline of the Function Caution Never write in EEPROM. Device-specific adjusted values are stored before shipment in AKM. Write operation is not needed in user operation. It may loose adjusted values. If these adjusted values are lost, AK8973 cannot operate normally. AK8973 includes an EEPROM consisting of 7 words by 8 bits. Each word can be read and written independently. Two interfaces, I2C bus standard mode (100kHz max.) and fast mode (400kHz max.), are supported. Before reading from or writing in the EEPROM, be sure to write "10" into MODE[1:0] bit of register MS1 and set the operation mode to EEPROM access mode. By this setting, the circuits such as the reference voltage circuit needed for the EEPROM access mode are started up (start-up wait time: 300μs). A high voltage required for write operation is generated inside the device. The EEPROM can be read from or written in depending on the setting of the "EEPROM data write enable/disable setting" which is written in the WEN[4:0] bit of register MS1. Operation Read Write WEN[4:0] bit setting Other than "10101" "10101" Address section A7-A0 A7-A0 Data section Description ED7-ED0 (out) ED7-ED0 (in) EEPROM memory read EEPROM memory write Table 5 * WEN bit of ST register can be used to check if the current mode is the read mode or write mode. When the EEPROM access mode is completed, set the MODE[1:0] to "11" for power-down, and then transit to another mode. MS0561-E-01 <Preliminary> - 24 - 2007/01 ASAHI KASEI 9.2. [AK8973] Operation Description EEPROM read and write operations are controlled by SCL pin, SDA pin, CAD1 pin, CAD0 pin, and WEN[4:0] bit. The function of "data transfer" is the same as described in 7.1. 9.2.1. READ Instruction Data can be read from the EEPROM by accessing an EEPROM address in the read mode (write disabled). AK8973 has two READ instructions of current address read and random read. To terminate READ operation, set MODE[1:0] of MS1 to "11" to transit to power-down mode. 9.2.1.1. Current Address READ AK8973 has an address counter inside the LSI chip. In current address read operation, the data at an address specified by this counter is read. The internal address counter holds the next address of the most recently accessed address. If the address most recently accessed (for WRITE or READ instruction) is address "n", and a current address read operation is attempted, the data at address "n+1" is read. For example, if read operations are performed in succession, data is read from 62H, 63H through 67H, 68H, 62H, and so on in this order. In current address read operation, AK8973 generates an acknowledge after receiving a slave address for the READ instruction (R/W bit="1"). Next, AK8973 transfers the data specified by the internal address counter starting with the next clock pulse, then increments the internal counter by one. If the master IC generates a stop condition instead of an acknowledge after AK8973 transmits one byte of data, the read operation stops. S T A R T SDA S S T O P R/W="1" Slave Address Data(n) A C K Data(n+1) A C K Data(n+2) A C K Data(n+x) A C K A C K P A C K Fig. 10 CURRENT ADDRESS READ 9.2.1.2. Random READ By random read operation, data at an arbitrary address can be read. Random read operation requires to execute WRITE instruction as dummy before a slave address for the READ instruction (R/W bit="1") is transmitted. In random read operation, a start condition is first generated then a slave address for the WRITE instruction (R/W bit="0") and a read address are transmitted sequentially. After AK8973 generates an acknowledge in response to this address transmission, a start condition and a slave address for the READ instruction (R/W bit="1") are generated again. AK8973 generates an acknowledge in response to this slave address transmission. Next, AK8973 transfers the data at the specified address then increments the internal address counter by one. If the master IC generates a stop condition instead of an acknowledge after data is transferred, the read operation stops. S T A R T SDA S S T A R T R/W="0" Slave Address Register Address(n) A C K S A C K S T O P R/W="1" Data(n) Slave Address A C K Data(n+1) A C K Data(n+x) A C K A C K P A C K Fig. 11 RANDOM READ MS0561-E-01 <Preliminary> - 25 - 2007/01 ASAHI KASEI [AK8973] 9.2.2. WRITE Instruction 9.2.2.1. Byte-Write Data is written at a specified address. A stop condition is required for every byte of data writing. Input a start condition, slave address (R/W="0"), address, and data in this order. AK8973 generates an acknowledge after receiving a slave address, after receiving an address, and after receiving data. Upon reception of a stop condition, AK8973 starts an internal programming cycle. During the internal programming cycle, avoid making accesses to any valid addresses of AK8973 for operations including read and write operations for registers. To stop the WRITE instruction, set WEN[4:0] bits of the MS1 register to other than "10101" when the internal programming time or more has elapsed. If the programming time is insufficient, correct writing of the last data is not guaranteed. In case that data is written in successively. W EN[4:0] "10101" S T A R T SDA S S T O P R/W ="0" Slave Address Register Address(n) A C K Data(n) A C K Twr: 10ms S T A R T S P A C K R/W ="0" Slave Address A C K In case of stopping write operation. W EN[4:0] "10101" S T A R T SDA S Other than "10101" S T O P R/W ="0" Slave Address Register Address(n) A C K Data(n) A C K Twr: 10ms P A C K Fig. 12 Byte-write MS0561-E-01 <Preliminary> - 26 - 2007/01 ASAHI KASEI 9.3. [AK8973] Memory Map Table 6 indicates the EEPROM memory map. There are eight addresses in total. Do not rewrite any data written in the EEPROM. Name Address A7 to A0 Data Description Number of bits 8 ETS 62H Offset adjustment for temperature sensor [5:0] EVIR 63H 8 EIHE 64H ETST 65H VREF (EVIR[7:4]) & IREF (EVIR[3:0]) adjustment value HE drive power supply correction value [7:4] & OSC adjustment value [3:0] For testing EHXGA 66H Magnetic sensor X-axis gain adjustment value 8 EHYGA 67H Magnetic sensor Y-axis gain adjustment value 8 EHZGA 68H Magnetic sensor Z-axis gain adjustment value 8 WRAL1 60H Address for batch EEPROM write Table 6 - 8 8 Factory-set value Individual adjustment value Individual adjustment value Individual adjustment value Individual adjustment value Individual adjustment value Individual adjustment value Individual adjustment value - <ETS, EVIR, EIHE> These data items are internally connected to registers of AK8973 to directly control adjustment values. Data other than ETS, EVIR, and EIHE is not directly connected to internal registers of AK8973. <ETST>, <WRAL1> Addresses for testing. Usually, do not access these addresses. <EHXGA, EHYGA, EHZGA> These addresses are used for magnetic sensor adjustment. These data items are read and set to HXGA, HYGA and HZGA registers respectively to adjust the sensitivity of each axis of the magnetic sensors. At addresses other than the above addresses, the EEPROM circuit of AK8973 does not operate. MS0561-E-01 <Preliminary> - 27 - 2007/01 ASAHI KASEI [AK8973] 10. Example of Recommended External Connection Pull up the bus of SDA pin to VID. VID AK8973 SDA Other LSI on same I2C bus VID (1.7V-VDD) VDD (2.5V - 3.6V) VDD VID 0.1μF 0.1μF SCL SDA INT RSTN Connect to the external CPU CAD0 CAD1 Fix to VSS or VID to assign the slave address AK8973 VSS TST1 TST2 TST3 NC1 NC2 NC3 NC4 Open Open Open Open Open Open Open MS0561-E-01 <Preliminary> - 28 - 2007/01 ASAHI KASEI [AK8973] 11. Package 11.1. Marking • Company logo: AKM • Product name: 8973 • Date code: X1X2X3X4 = Year X1 X2X3 = Week = Lot X4 AKM 8973 XXXX 11.2. Pin Assignment 9 16 NC1 VSS 10 15 TST2 VDD 11 14 TST3 NC4 12 13 NC2 NC3 AK8973 Top View 3 4 CAD1 VID SDA CAD0 2 1 MS0561-E-01 <Preliminary> - 29 - 8 RSTN 7 INT 6 TST1 5 SCL 2007/01 ASAHI KASEI [AK8973] 11.3. Outline Dimensions [mm] 11.4. Recommended Foot Print Pattern [mm] MS0561-E-01 <Preliminary> - 30 - 2007/01 ASAHI KASEI 12. [AK8973] Relationship between the Magnetic Field and Output Code The AD converter code increases as the magnetic flux density increases in the arrow directions. On the Z-axis, the AD converter code increases as the magnetic flux density in the direction from the back of the package to the front face increases. Z X Y AKM 8973 XXXX Top View Important Notice • • • • • These products and their specifications are subject to change without notice. Before considering any use or application, consult the Asahi Kasei Microsystems Co., Ltd. (AKM) sales office or authorized distributor concerning their current status. AKM assumes no liability for infringement of any patent, intellectual property, or other right in the application or use of any information contained herein. Any export of these products, or devices or systems containing them, may require an export license or other official approval under the law and regulations of the country of export pertaining to customs and tariffs, currency exchange, or strategic materials. AKM products are neither intended nor authorized for use as critical components in any safety, life support, or other hazard related device or system, and AKM assumes no responsibility relating to any such use, except with the express written consent of the Representative Director of AKM. As used here: (a) A hazard related device or system is one designed or intended for life support or maintenance of safety or for applications in medicine, aerospace, nuclear energy, or other fields, in which its failure to function or perform may reasonably be expected to result in loss of life or in significant injury or damage to person or property. (b) A critical component is one whose failure to function or perform may reasonably be expected to result, whether directly or indirectly, in the loss of the safety or effectiveness of the device or system containing it, and which must therefore meet very high standards of performance and reliability. It is the responsibility of the buyer or distributor of an AKM product who distributes, disposes of, or otherwise places the product with a third party to notify that party in advance of the above content and conditions, and the buyer or distributor agrees to assume any and all responsibility and liability for and hold AKM harmless from any and all claims arising from the use of said product in the absence of such notification. MS0561-E-01 <Preliminary> - 31 - 2007/01