HMC6343
8
The receiving device (addressed slave) will pull the SDA line low to acknowledge (ACK) the successful transfer or leave
the SDA high to negative acknowledge (NACK).
Per the I
2C spec, all transitions in the SDA line must occur when SCL is low. This requirement leads to two unique
conditions on the bus associated with the SDA transitions when SCL is high. Master device pulling the SDA line low while
the SCL line is high indicates the Start (S) condition, and the Stop (P) condition is when the SDA line is pulled high while
the SCL line is high. The I
2C protocol also allows for the Restart condition in which the master device issues a second
start condition without issuing a stop.
All bus transactions begin with the master device issuing the start sequence followed by the slave address byte. The
address byte contains the slave address; the upper 7 bits (bits7-1), and the Least Significant bit (LSb). The LSb of the
address byte designates if the operation is a read (LSb=1) or a write (LSb=0). At the 9 th clock pulse, the receiving slave
device will issue the ACK (or NACK). Following these bus events, the master will send data bytes for a write operation, or
the slave will clock out data with a read operation. All bus transactions are terminated with the master issuing a stop
sequence.
I2C bus control can be implemented with either hardware logic or in software. Typical hardware designs will release the
SDA and SCL lines as appropriate to allow the slave device to manipulate these lines. In a software implementation, care
must be taken to perform these tasks in code.
I2C Slave Address
The I
2C slave address byte consists of the 7 most significant bits with the least significant bit zero filled. As described
earlier, the default (factory) value is 0x32 and the legal I
2C bounded values are between 0x10 and 0xF6. This slave
address is in EEPROM address 0x00. Users can change the slave address by writing to this location. Any address
updates will become effective after the next power up or after a reset command.
Software Version
This EEPROM software version number byte contains the binary value of the programmed software. Values of 0x05 and
beyond are considered production software.
Deviation Angle Correction
Typically the HMC6343 X-axis (or Z-axis) is designated the forward direction of the compass, and is placed mechanically
towards the forward direction of the end user product. The deviation angle is used to correct for mechanical angle errors
in package orientation by adding the deviation angle to the internal compass heading before the result is placed as the
computed heading. Two EEPROM Bytes are used to store the deviation angle, and the binary value is in tenths of a
degree and in two’s complement form for a ±1800 representation. The deviation angle MSB is located in EEPROM
register 0x0B and the LSB in 0x0A.
Variation Angle Correction
The variation angle or declination angle of the HMC6343 is the number of degree that must be added to the internal
compass heading to convert the magnetic north reference direction to the geographic (true) north reference direction. This
angle information is provided to the HMC6343 from external latitude and longitude data processed through a World
Magnetic Model equation to compute variation angle, or by lookup table. Two EEPROM Bytes are used to store the
variation angle, and the binary value is in tenths of a degree and in two’s complement form for a ±1800 representation.
The deviation angle MSB is located in EEPROM register 0x0D and the LSB in 0x0C.
Magnetometer Offsets
The Magnetometer Offset bytes are the values stored after the completion of the last factory or user hard-iron calibration
routine. Additional value changes are possible, but will be overwritten when the next calibration routine is completed. Note
that these offset values are added to the sensor offset values computed by the set/reset routine to convert the raw
magnetometer data to the compensated magnetometer data. These values are written into EEPROM addresses 0x0E to
0x13 and loaded to RAM on the power up.