Test CMPS11- I2C Mode with Comm Operator

Comm Operator v4.9 supports Quick Send – I2C Panel. It provides a way to  communicate with I2C devices through FTDI FT232H based USB to I2C bridge.

Here will show you how to test CMPS11 –I2C Mode with Comm Operator I2C Panel.

CMPS11 - Tilt compensated compass

CMPS11 is tilt compensated compass module of Robot Electronics.

Download Comm Operator v4.9 beta version.

Step 1: Download and install Comm Operator.

Step 2: Connect CMPS11 with your computer through FTDI FT232H based USB to I2C bridge. According to CMPS11 document, leave the Mode pin unconnected to enter the I2C mode.

CMPS11 I2C Mode

Connect  CMPS11 with Computer by FTDI USB-I2C Bridge

Step 3: Run Comm Operator, and Open Connection –> I2C Bridge to connect CMPS11 module.

Comm Operator - I2C Bridge - Connect CMPS11

Step 4: Click menu View –> I2C Panel to show Quick Send – I2C Panel.

Comm Operator - I2C Panel

Comm Operator - Quick Send - I2C Panel

Step 5: Click Scan button to search CMPS11 module I2C address.

Scan I2C Devices

If you know the device address, you can just select it from the drop-down list.

Comm Operator - I2C Device Address

Step 6: CMPS11 module is ready to communicate in I2C mode now.

According to I2C protocol and CMPS11 document, CMPS11 has a 28-byte array of registers, organized as below.

CMPS11 I2C Mode -Registers and Function

Example 1:  Read the version

Check Write and Read, and input data ”00” in HEX format (It’s the Register 0.), then click Send button to read the version value.

Test CMPS11 with Comm Operator

Example 2: Read compass bearing 8-bit

Check Write and Read, and input data ”01” in HEX format (It’s the Register 1.), then click Send button to read compass bearing 8-bit.

Test CMPS11 with Comm Operator - Read Compass Bearing

Here compass bearing 8-bit value is 110.  According to 0-255 for a full circle 0-359 degree, (110/255)*359=154.86, it is about 155 degree. 

CMPS11 Compass Bearing 0-255 for 0-359 degree

Example 3: Read compass bearing 16-bit

Check Write and Read. Input data ”02” in HEX format, and select Read Data Length “2”(It will read Register 2 and 3) , then click Send button to read compass bearing 16-bit.

Here compass bearing 16-bit value is 0x0613. Click Calc button to open Calculator panel, input Hex 0613, click update button to get its Decimal 1555. According to 0-3559 representing 0-359.9 degree, compass bearing is 155.5.

If CMPS11 module is moved, repeat to read Register 1, 2 and 3 the compass bearing value will be changed.

Test CMPS11 with Comm Operator - Read Compass Bearing 16-bit

Step 7: Click Edit button to show I2C Data Editor. You can edit address and data here in binary.

Comm Operator - I2C Data Editor

Step 8: Check Add to List when you send data to CMPS11 module, the data will be added to Send Data List automatically. It’s pretty handy to save the list for later use. You can also Download CMPS11-I2C.sds file, and load it in Comm Operator directly to test your CMPS11 module.

Comm Operator - CMPS11 I2C Send Data List

Back to Comm Operator homepage

This entry was posted in Comm Operator and tagged , , , , , . Bookmark the permalink.