This is a project for interfacing FRDM-STBC-AGM01 sensor module to FRDM-KL43Z using Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert. This board is 9-axis Sensor Toolbox Development Board Enabled for sensor fusion with FXAS21002C 3-axis gyroscope and FXOS8700C 6-axis integrated e-compass, as part of the Freescale Freedom development platform
This project has 4 state machines:
1) Default mode: this will prompt the user to press the push button
2) Accelerometer mode: when button is pressed once from its earlier state, it enters into accelerometer mode of working where the sensor FXOS8700CQ is active and displays 3 axis 14-bit accelerometer value.
3) Magnetometer mode: when button is pressed from its earlier state, it enters into this mode where the sensor FXOS8700CQ starts to work and 16-bit 3-axis magnetometer data is displayed on terminal.
4) Gyrometer mode: we need to press the push button as did earlier to enter into this mode. In this mode the sensor FXAS21002C is active and it displays 3-axis 16-bit gyro data on the terminal.
5) Temperature mode: You need to press the push button inorder to enter into this mode. In this mode the sensor device FXAS21002C is active and it displays temperature in degree Celsius.
The state machine diagram is as shown:
Hardware details of STBC-AGM01 9-axis Sensor
It has FXAS21002C 3-axis gyroscope and FXOS8700C 6-axis integrated e-compass as part of the
Freescale Freedom development platform
Schematic can be referred HERE
We are connecting
I2CSDA0 of STBC to I2C1SDA of KL43Z freedom board and
I2CSCL0 of STBC to I2C1SCL of KL43Z which are PTE0 (SDA) and PTE1 (SCL) pins of KL43Z board.
The corresponding 7-bit I2C slave address of STBC sensor board are
FXAS21002C is 0x20
FXOS8700CQ is 0x1E
The interrupt pins of the sensor are connected as follows:
INT1- 8700 > J1-6 > PTD3
INT1-21002 > J1-12 > PTA5
I have enclosed the project folder and executables, download the project and open it in KDS IDE import the project to your current workspace.
Build the project and execute it.
Connect the sensor board to FRDM-KL43Z board as shown below:
After compiling and executing the code you can see the output in an hyper terminal with baud rate of 19200 as shown below:
Mode-1 output window:
Mode-2 output (Accelerometer data):
Mode-3 output (Magnetometer data):
Mode-4 output (Gyro data):
Mode-5 output (Temperature data):
The executable are attached along with this to test at your end and the project folder for quick reference
You can refer to my earlier blog to know about the processor expert components used in the project it is similar to the one below:








