Digilent PmodCMPSTM Reference Manual Revision: September 9, 2013 Note: This document applies to REV B of the board. 1300 NE Henley Court, Suite 3 Pullman, WA 99163 (509) 334 6306 Voice | (509) 334 6300 Fax Overview The Digilent PmodCMPS features the popular Honeywell HMC5883L 3-axis digital compass and can add compass heading readings to any Digilent host board with an I2C interface. Pmod CMPS Features Include: * * * * * I2C communication interface with daisy chain connectors 8 gauss field detection external header for access to DRDY (data ready) pin optional pull-up resistors for SCL and SDA pins 160 Hz maximum data output rate Functional Description The PmodCMPS can be configured to run in single measurement or continuous measurement mode. Each mode has different maximum output rates. The magnetic field measured on each axis is represented as a signed 16-bit word with the five most significant bits being the sign bits. There are two eight bit registers for each axis. Once one data register is read, the other five data registers must be read before any new data can be written to those registers. The internal address pointer automatically increments when a register is successfully read from. Once the address pointer is incremented past 0x09, it will roll over to 0x03, which represents the first axis output data register. I2C Interface The PmodCMPS is an I2C slave device that is compatible with standard and fast modes (100 kHz and 400 kHz, respectively). The 7-bit address of the PmodCMPS will be 0x1E. This address corresponds to 0x3C for a write operation and 0x3D for a read operation. Details on the I2C operations are provided below: Write A write operation can be initiated with a Start condition on the I2C bus, followed by 0x3C. When writing to a register, the desired registers address must be sent as the next byte after the PmodCMPS acknowledges that it has been addressed. The bytes sent by the master to the PmodCMPS are shown below: 1. 7-bit addresss of the PmodCMPS + write bit (0) 2. Address of internal register to write to 3. Data Doc: 502-285 page 1 of 2 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. Digilent PmodCMPS Read A read operation can be initiated with a Start condition on the I2C bus, followed by 0x3D. After the PmodCMPS acknowledges that it has been addressed on the 9th clock pulse, the data to be read will be output from the device on the next 8 clock pulses. The data sent will be from the address pointed to by the internal address pointer. This will have either been automatically incremented from the previous read operation, or set by the previous write operation. 1. 7-bit address of the PmodCMPS + read bit (1) 2. Master reads data byte sent from PmodCMPS 3. (Loop) Note that step three is necessary when reading the 6 axis data registers. The master should read all six data registers at once. Set Address Pointer The address pointer can be set to any register by only completing steps one and two from the write procedure (listed above). After the PmodCMPS acknowledges the register address, the master should create a Stop condition on the I2C bus. Note: For more information on the operation of the PmodCMPS, please see the HMC5883L data sheet available from www.honeywell.com. www.digilentinc.com page 2 of 2 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Digilent: 410-285