Interfacing MW2x devices with FXOS8700 6-Axis sensor (or MMA8451) using BeeStack I2C drivers

Document created by AngelC Employee on Apr 30, 2015Last modified by AngelC Employee on Apr 30, 2015
Version 2Show Document
  • View in full screen mode

BeeStack solutions included in BeeKit contain several low level drivers that definitely ease customer’s development phase.  Ranging from UART, SPI, NVM, I2C, among many others, these drivers could be used to interface the MW2x devices with different devices or sensors.

 

It is also true these drivers will not support all custom applications by default, but they are conveniently provided in source code so anyone can modify them to the application’s needs. One example would be the need to use an accelerometer such as FXOS8700 or MMA8451. In this case, the default functionality of the I2C drivers might not be well-suited to work with these devices out-of-the-box. Nevertheless, this could be achieved with simple modifications to the source code.

 

This project implements the basic I2C functionality to interface a TWR-KW24D512 board with a FXOS8700 sensor using the drivers included in Kinetis BeeStack Codebase 4.0.x solutions. The demo uses a ZigBee Home Automation GenericApp template to initialize and periodically read the accelerometer data X, Y and Z. A change in the registers read and written would be enough to use MMA8451 instead.  Following images illustrate the I2C frames obtained from the analyzer:

 

FXOS8700 Initialization:

FXOS8700_Accel_init.JPG.jpg

Accelerometer X-Axis Data:

FXOS8700_Accel_ReadX.JPG.jpg

Accelerometer Y-Axis Data:

FXOS8700_Accel_ReadY.JPG.jpg

Accelerometer Z-Axis Data:

FXOS8700_Accel_ReadZ.JPG.jpg

 

IMPORTANT NOTE:

Support of the attached project is limited. Please use this project as reference only. If it does not fulfill your requirements, you could always modify its source code to meet you application’s needs.

Outcomes