FXOS8700CQ tilt-compensated compass evaluation with FRDM-KL26Z

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXOS8700CQ tilt-compensated compass evaluation with FRDM-KL26Z

Jump to solution
2,736 Views
mbdl
Contributor II

Hello

 

I’ve been using the MAG3110 as a compass in a product of mine for some time now but am looking at incorporating tilt compensation and so I’ve decided to evaluate the FXOS8700CQ to exploit its accelerometer data for this purpose.

 

I went ahead and purchased the FRDM-KL26Z board which includes a FXOS8700CQ after being linked to Sensor Fusion Toolbox software and a ZIP of some software samples I assumed would make evaluation quick and painless, however it appears that none of the provided source code samples nor the toolbox software actually utilize the on-board device at all (other than as an accelerometer) but instead require some costly expansion card with the exact same part to do so!

 

Is there anything at all already written for this board to make use of the on-board FXOS8700CQ as a tilt compensated compass that can perhaps link with the toolbox for quick and easy visualization?

 

m

Labels (1)
0 Kudos
Reply
1 Solution
1,997 Views
mbdl
Contributor II

I found the problem. One more step to the above is to comment-out other unused devices in build.h:

//#define USE_MPL3115

#define USE_FXOS8700

//#define USE_FXAS21000

//#define USE_FXAS21002

//#define USE_MMA8652

//#define USE_MAG3110

Now the LED flashes green and the toolbox software is working :smileyhappy:

View solution in original post

0 Kudos
Reply
4 Replies
1,997 Views
michaelestanley
NXP Employee
NXP Employee

Mikael,

Good question.  This is an easy adjustment to make when using the Sensor Fusion Toolbox.  The kit uses Processor Expert generated Logical Device Drivers to represent the hardware components.  The user manual for the KL26Z shows that the FXOS8700CQ is connected to the I2C0 port at PTE25:24 and has address 0x1D.

  • In the PE Component Inspector window for the I2C component, change:
    • I2C channel to I2C0
    • SDA pin to PTE25
    • SCL pin to PTE24
  • Press the "Generate Processor Expert Code" button in the Components pane
  • In Sources/drivers.c, change FXOS8700_I2C ADDR from 0x1E to 0x1D
  • in Sources/build.h, comment out all algorithms except COMPUTE_6DOF_GB_BASIC
  • Compile download and run

That should be all it takes to compile the 6-axis eCompass.  The generated application will still be usable with both Windows and Android versions of the Sensor Fusion Toolbox.  Just don't select any of the algorithms that you did not include in the build.

Regards,

Mike

0 Kudos
Reply
1,997 Views
mbdl
Contributor II

Mike,

Thanks for the quick response!

I've done exactly the above using the FRDM-KL26Z code imported from the Kinetis Sensor Fusion Lib and all seems to have gone well (it compiles and appears to be running), however I'm still unable to connect via the Windows application.

If I click Auto Detect I get the error "Cannot open a port to the sensor board." despite selecting correct port and "Tilt Compensated Compass".

I don't see any activity when scoping SDA and SCL but I figure the GUI front end must be linked before anything wakes up?

The only other thing I've had to change was the MQXLITE version from 1.1.1 to 1.1.0 under the PE Component Inspector but this never brought up any warnings or errors. Codewarrior crashes when updating so I can't do much about this just now.

I assume it is OK to ignore the warning about SCL frequency being >100kHz (setting is 375kHz, below the 400kHz stated in datasheet)?

Regards

Mikael

0 Kudos
Reply
1,998 Views
mbdl
Contributor II

I found the problem. One more step to the above is to comment-out other unused devices in build.h:

//#define USE_MPL3115

#define USE_FXOS8700

//#define USE_FXAS21000

//#define USE_FXAS21002

//#define USE_MMA8652

//#define USE_MAG3110

Now the LED flashes green and the toolbox software is working :smileyhappy:

0 Kudos
Reply
1,997 Views
michaelestanley
NXP Employee
NXP Employee

FANTASTIC!  And thanks for posting the additional step I omitted.

0 Kudos
Reply