AN 038. Getting Started with the KXTJ2. Introduction

Similar documents
KXCJK AN 039. Getting Started with the KXCJK. Introduction

AN065. AN065 Getting Started with the KXTJ3. Introduction

AN023. Getting started with the KXTF9. Introduction. Circuit Schematic

AN 025 Getting Started with the KXTI9

AN049. Getting Started. 1. Introduction

AN055. Replacing KX023, KX123, KX124 with KXG07. Introduction

Note: Examples discussed in this application note pertain to State Program 2.

± 2g / 4g / 8g Tri-axis Digital Accelerometer Specifications

± 2g / 4g / 8g / 16g Tri-axis Digital Accelerometer Specifications

EZ430-C9. Getting Started with Kionix EZ430-C9 Evaluation Board for the Texas Instruments MSP430 USB Stick Development Tool

± 2g Tri-axis Digital Accelerometer Specifications

± 2g / 4g / 6g / 8g Tri-axis Digital Accelerometer Specifications

This technical note is intended to provide information about the proper power-on procedure of the Kionix KMX62, KMX63 sensors.

± 2g / 4g / 8g Tri-axis Digital Accelerometer Specifications

± 2g / 4g / 8g Tri-axis Digital Accelerometer Specifications

Modern Robotics Inc. Sensor Documentation

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g

Stream Mode, collect up to and holds the last 4096 bytes of data plus two (2) additional sets discarding oldest data to make room for newer data.

MMA865xFC Sensor Toolbox User s Guide

± 2g / 4g / 8g Tri-axis Digital Accelerometer Specifications

ROHM Sensor Evaluation Kit USER MANUAL

MMA845xQ Sensor Toolbox User s Guide

± 8g / 16g / 32g Tri-axis Digital Accelerometer Specifications

VSEW_mk2-8g. Data Sheet. Dec Bruno Paillard

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

± 10g Tri-axis Accelerometer Specifications

BMM150 Geomagnetic Sensor

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX

MOTENC Axis PCI Motion & I/O Control Board. Reference Manual Rev 1A, April Copyright 2004 VITAL Systems Inc

Using the Xtrinsic FXLS8471CQ Transient-Acceleration Function

ArduCAM-M-2MP Camera Shield

A0021. Overview. Features. Ordering Information. HSS Touch Signature IC 6 Input - I 2 C. Part Number Format: A X Y Z

± 2g Tri-axis Accelerometer Specifications

A0061. Overview. Features. Ordering Information. HSS Touch Signature IC 15 Input - I 2 C. Part Number Format: A X Y Z

Parallax LSM9DS1 9-axis IMU Module (#28065)

mcube Proprietary APS v1.0 1 / mcube Inc. All rights reserved.

CyberAtom X-202 USER MANUAL. Copyrights Softexor 2015 All Rights Reserved.

Accelerometer with Analog and Digital I/O for StackableUSB USB1600

MAG3110 Frequently Asked Questions

PAT9125EL: Optical Tracking Miniature Chip

MOTENC-Lite 4-Axis PCI Motion & I/O Control Board. Reference Manual Rev 1.1, June 20, Copyright 2005 VITAL Systems Inc

GENERAL DESCRIPTION MC3635 FEATURES

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

MC3635 FEATURES GENERAL DESCRIPTION

Product Family Specification

ECV ecompass Series. Technical Brief. Rev A. Page 1 of 8. Making Sense out of Motion

TPMC Digital Inputs/Outputs (Bit I/O) Version 2.0. User Manual. Issue February 2014

± 2g Tri-axis Accelerometer Specifications

± 2g Tri-axis Accelerometer Specifications

Gyroscope Module 3-Axis L3G4200D (#27911)

Accel 5 click. PID: MIKROE 3149 Weight: 24 g

IP-48DAC channel 16-bit Digital/Analog Converter With memory Industry Pack Module PROGRAMMING MANUAL Version 1.

± 1200uT Tri-axis Digital Magnetometer/ ± 2g/4g/8g/16g Tri-axis Digital Accelerometer Specifications

Sensor Toolbox (Part 2): Inertial Sensors

AN 006. Handheld Electronic Compass Applications Using a Kionix MEMS Tri-Axis Accelerometer. Introduction

Altimeter / Barometer Module SMD500 ultra low power, low voltage

AN-1025 APPLICATION NOTE

± 2g Tri-Axis Accelerometer Specifications

SmartFan Fusion-4. Speed Control and Alarm for DC Fans CONTROL RESOURCES INCORPORATED. The driving force of motor control & electronics cooling.

IST8301C 3D Magnetometer Sensor. Datasheet

XDK HARDWARE OVERVIEW

Logosol Joystick Node LS-731

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

2011 FIRST Robotics Competition Sensor Manual

USB Virtual Reality HID. by Weston Taylor and Chris Budzynski Advisor: Dr. Malinowski

SECOND EDITION. Arduino Cookbook. Michael Margolis O'REILLY- Tokyo. Farnham Koln Sebastopol. Cambridge. Beijing

CyberAtom X-200 USER MANUAL. Copyrights Softexor 2015 All Rights Reserved.

MODEL SW6000 & SM6100 CENELEC INSTRUCTIONS

USB-Based 14-Channel Data-Acquisition Module

TIP120. Motion Controller with Incremental Encoder Interface. Version 1.0. User Manual. Issue August 2014

AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision )

SCA8X0-21X Demo Kit User Manual. Doc.Nr C

IPC. Preliminary Data Brief. IPC High speed phase current sensor with digital interface Draft Review Released

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI)

OPERATIONAL UP TO. 300 c. Microcontrollers Memories Logic

OEM-ORP ORP. Reads mV mV. Range. 1 reading every 420ms. Response time. Any type & brand. Supported probes. Single point.

Evaluation Board User Guide UG-047

Lab 5: EBI and ADC: Digital Voltmeter

Arduino Cookbook O'REILLY* Michael Margolis. Tokyo. Cambridge. Beijing. Farnham Koln Sebastopol

Application Guidelines for LIS3DSH State Machine

XS S ERIES TM PMB US TM O PTION C ARD

Cross-Domain Development Kit XDK110 Platform for Application Development

ASM330LHH. Automotive 6-axis inertial module: 3D accelerometer and 3D gyroscope. Data brief. Features. Applications. Description

D115 The Fast Optimal Servo Amplifier For Brush, Brushless, Voice Coil Servo Motors

AMS 5812 OEM pressure sensor with an analog and digital output

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Introduction to MATLABs Data Acquisition Toolbox, the USB DAQ, and accelerometers

Combining Today s Best Technologies. For Tomorrow s Break Through Discoveries. Feedback Versions Analog Sin/Cos. Control Modes.

GMA301 ±6g Tri-Axial Digital Accelerometer

Specification E2 Interface

Table of Contents 1 Typical Applications General Description Block Diagram Pinout System Connections Typical A

Compass Module 3-Axis HMC5883L (#29133)

Using an Analog Devices AD774X Capacitance-to-Digital Converter for Differential Button Sensor Operation

DaqBoard/1000. Series 16-Bit, 200-kHz PCI Data Acquisition Boards

MPU-6000/MPU Axis Evaluation Board User Guide

Serial communications with SPI

QSB Command List. Document Version /15/2017

Fully Integrated Thermal Accelerometer MXC6225XU

Main components MEMS digital output motion sensor: high-performance ultra-low-power 3-axis "femto" accelerometer

3DM-GX1 Data Communications Protocol

Transcription:

Getting Started with the KXTJ2 Introduction This application note will help developers quickly implement proof-of-concept designs using the KXTJ2 tri-axis accelerometer. Please refer to the KXTJ2 data sheet for additional implementation guidelines. While Kionix strives to ensure that our accelerometers will meet design expectations by default, it has ever so closed the gap by allowing users to autonomously analyze sensor outputs. KXTJ2 is an extension of the KXTJ9 product to a 2 x 2 mm 12-pin. The KXTJ2 is significantly lower in current than our previous offerings. The KXTJ2 provides an I2C bus interface and small 2x2 footprint with 12 pads compatible with Bosch 222/250 series products. The KXTJ2 also provides a low power motion wake up feature which is demonstrated in this application note. Circuit Schematic This section shows recommended wiring for the KXTJ2, based on proven operation of the part. Specific applications may require modifications from these recommendations. Please refer to the KXTJ2 Data Sheet for all pin descriptions. Figure 1. KXTJ2 Application Schematic 36 Thornwood Dr. Ithaca, NY 14850 tel: 607-257-1080 fax: 607-257-1146 www.kionix.com - info@kionix.com Page 1 of 12

Quick Start Implementation Here we present two basic ways to initialize the part and explore the Wake-Up (motion detect) functionality. These can vary based on desired operation, but generally the initial operations a developer wants to do are: 1) Asynchronous read back acceleration data, 2) Synchronous hardware interrupt read back acceleration data, 3) Wake-Up function via latched physical hardware interrupt. There are other ways that the interrupt sources can be read via status registers (software interrupt) in the device that can be used to check if the interrupt event has occurred and these are not explored here. 1- Asynchronous Read Back Acceleration Data (Setting G-Range and ODR) - Write 0x00 to Control Register 1 (CTRL_REG1) to initialize accelerometer in stand-by mode. (PC1 = 0) CTRL_REG1 0x1B 0001 1011 0x00 0000 0000 - Write 0x40 to Control Register 1 (CTRL_REG1) to keep the accelerometer in stand-by mode, to set the performance mode of the KXTJ2 to high current 12 bit resolution since we are setting the G-range to +/-2g. (Note: 14 bit resolution is only available when the G-range is +/-8g) CTRL_REG1 0x1B 0001 1011 0x40 0100 0000 - Write 0x02 to Data Control Register (DATA_CTRL_REG) to set the Output Data Rate (ODR) of the accelerometer to 50 Hz. (Note: This is the default value. Output Data Rates >= 400Hz will force device into Full Power mode (PC1 = 1, RES = 1)) DATA_CTRL_REG 0x21 0010 0001 0x02 0000 0010 - Write 0xC0 to Control Register 1 (CTRL_REG1) to set the accelerometer into operating mode (PC1 = 1) CTRL_REG1 0x1B 0001 1011 0xC0 1100 0000 Page 2 of 12

- Acceleration data can now be read from the XOUT_L, XOUT_H, YOUT_L, YOUT_H, ZOUT_L, and ZOUT_H registers in 2 s complement format as shown in the next tables depending on the performance mode (resolution) selected before. For example, to read a 12 bit value, XOUTD11 to XOUTD0, then XOUTD11 to XOUTD4 bit positions are located in XOUT_H register and the remaining 4 bits XOUTD3 to XOUTD0 are located in the upper nibble of the XOUT_L. The previous statement also applies to the Y and Z axis. Page 3 of 12

Page 4 of 12

Page 5 of 12

2- Synchronous Hardware Interrupt Read Back Acceleration Data (Setting G-Range and ODR) - Write 0x00 to Control Register 1 (CTRL_REG1) for the purpose to initialize accelerometer in stand-by mode. (PC1 = 0) CTRL_REG1 0x1B 0001 1011 0x00 0000 0000 - Write 0x60 to Control Register 1 (CTRL_REG1) to keep the accelerometer in stand-by mode, to set the performance mode of the KXTJ2 to high current 12 bit resolution since we are setting the G-range to +/-2g. (Note: 14 bit resolution is only available when the G-range is +/-8g). Also enable the availability of new data as an interrupt. CTRL_REG1 0x1B 0001 1011 0x60 0110 0000 - Write 0x38 to Interrupt Control Register (INT_CTRL_REG1) to enable physical interrupt pin(5), to set the polarity of the physical interrupt to active high and to transmit interrupt pulses with a period of 0.03 ms to 0.05 ms in pin(5). INT_CTRL_REG1 0x1E 0001 1110 0x38 0011 1000 - Write 0x02 to Data Control Register (DATA_CTRL_REG) to set the Output Data Rate (ODR) of the accelerometer to 50 Hz. (Note: This is the default value. Output Data Rates >= 400Hz will force device into Full Power mode (PC1 = 1, RES = 1)) DATA_CTRL_REG 0x21 0010 0001 0x02 0000 0010 - Write 0xE0 to Control Register 1 (CTRL_REG1) to set the accelerometer into operating mode (PC1 = 1) CTRL_REG1 0x1B 0001 1011 0xE0 1110 0000 Page 6 of 12

- Acceleration data can now be read from the XOUT_L, XOUT_H, YOUT_L, YOUT_H, ZOUT_L, and ZOUT_H registers in 2 s complement format as shown in the tables shown previously depending on the performance mode (resolution) selected before. For example, to read a 12 bit value, XOUTD11 to XOUTD0, then XOUTD11 to XOUTD4 bit positions are located in XOUT_H register and the remaining 4 bits XOUTD3 to XOUTD0 are located in the upper nibble of the XOUT_L. The previous statement also applies to the Y and Z axis. 3- Wake Up Function via latched physical hardware interrupt - Write 0x00 to Control Register 1 (CTRL_REG1) for the purpose to initialize accelerometer in stand-by mode. (PC1 = 0) CTRL_REG1 0x1B 0001 1011 0x00 0000 0000 - Write 0x42 to Control Register 1 (CTRL_REG1) to keep the accelerometer in stand-by mode, to set the performance mode of the KXTJ2 to high current 12 bit resolution since we are setting the G-range to +/-2g. (Note: 14 bit resolution is only available when the G-range is +/-8g). Also enable the Wake Up (motion detect) function. CTRL_REG1 0x1B 0001 1011 0x42 0100 0010 - Write 0x06 to Control Register 2 (CTRL_REG2) to set the Output Data Rate of the Wake Up function (motion detection) (OWUF) to 50 Hz. CTRL_REG2 0x1D 0001 1101 0x06 0000 0110 - Write 0x7F to Interrupt Control Register 2 (INT_CTRL_REG2) to define the direction of detected motion for all positive and negative directions: x positive (x+), x negative (x-), y positive (y+), y negative (y-), z positive (z+), z negative (z-) directions. INT_CTRL_REG2 0x1F 0001 1111 0x7F 0111 1111 Page 7 of 12

- Write 0x05 to Interrupt Wake-Up Timer (WAKEUP_TIMER) to set the time motion must be present before a wake-up interrupt is set to 0.1 second. The following formula is used: WAKEUP_TIMER (counts) = Desired Delay Time (sec) x OWUF (Hz) WAKEUP_TIMER (counts) == 0.1 x 50 = 5 counts Since the desired delay time is 0.1 second and the OWUF was previously set to 50 Hz, then the Wake-Up Timer is 5 counts (0000 0101). WAKEUP_TIMER 0x29 0010 1001 0x05 0000 0101 - Write 0x18 to Interrupt Wake-Up Threshold (WAKEUP_THRESHOLD) to set the level to 0.5g. The following formula is used: WAKEUP_THREHOLD (counts) = Desired Threshold (g) x 16 (counts/g) WAKEUP_THREHOLD (counts) =0.5 x 16 =8 counts Note that this threshold is differential with respect to the previous reading. WAKEUP_THRESHOLD 0x6A 0110 1010 0x08 0000 1000 - Write 0x30 to Interrupt Control Register (INT_CTRL_REG1) to output the physical interrupt of the previously defined Wake-Up detect function. This value will create an active high and latched interrupt. INT_CTRL_REG1 0x1E 0001 1110 0x30 0011 0000 Page 8 of 12

- Write 0xC2 to Control Register 1 (CTRL_REG1) to set the accelerometer in operating mode with the previously defined settings. CTRL_REG1 0x1B 0001 1011 0xC2 1100 0010 - Move the KXTJ2 and monitor the physical interrupt (INT pin 5) of the accelerometer, if the acceleration input profile satisfies the criteria previously established for the 0.5g motion detect threshold level in both positive and negative directions of the X, Y, Z axis for more than 0.1 second, then there should be positive latched interrupt present. - Read Interrupt Release (INT_REL) register to unlatch (clear) the output interrupt created by the motion detection function. Hex Binary INT REL 0x1A 0001 1100 - Monitor the physical interrupt (INT pin 5) of the accelerometer, the positive latched interrupt should not be present. Repeat the last two steps of moving the accelerometer and clearing the interrupt as needed to test this motion detect functionality based on the previous settings. Page 9 of 12

Timing Requirements There are several timing requirements that developers should keep in mind when working with the KXTJ2. I²C Clock - The I²C Clock can support Fast Mode up to 400 KHz and High Speed mode up to 3.4 MHz. Power Up to Communication - After the part is powered up, it takes 10ms before it is ready for I²C communication. Enable to Valid Outputs - After the part is enabled (PC1 bit in Control Register 1 is asserted), it takes from 2.1 ms to 80 ms depending on the ODR before the acceleration outputs are valid. (See KXTJ2 Product Specification for details) Software Reset/Power On Reset Delay - After a Software or Power On Reset, the part takes 10ms before it is ready for I²C communication. Troubleshooting All Interrupt Issues - Make sure the KXTJ2 is configured to issue interrupt signals in the way that your GPIO is programmed to handle them. - An oscilloscope on the physical interrupt pin can be a valuable tool to confirm physical interrupt operation. Page 10 of 12

Accelerometer USB Development Kit Kionix offers an Accelerometer USB Development Kit that can be used to quickly begin the development of applications and firmware that incorporate Kionix accelerometers including the KXTJ2. The Development Kit provides a common interface to Kionix evaluation boards. For additional information regarding the development kit please refer to Kionix Application Firmware Development Kit user manual. Here is a brief description of the applications and utilities supported by the development kit SensorScope This application allows the user to monitor data coming from the attached sensor. This data can be saved to a file or viewed in real time. With only two verification steps, the application will display a series of graphs representing acceleration with respect to time for each axis. This data can be used to measure the noise of the accelerometer by using the following steps: - Place the evaluation board on a flat surface in the desired orientation. - To change the application settings, select Settings from the Edit menu. On this menu the following settings can be changed: - Sampling Rate - The rate at which the software queries the accelerometer for axis data. - Realtime Interval - The amount of data the software will buffer and display in real time. - Select the capture button. The application will begin to capture data immediately. Captured data is written to a file, and will not be viewable until after the capture has finished. The status bar is used to notify the user of a capture in progress. - The application will continue to collect data until the user clicks the Stop button, or the resulting capture file has exceeded the file size limits (~1Gigabyte). We recommend collecting the data for at least 120 seconds. - Captured data will be saved as a list of comma-separated values (.csv). Each entry in the list is comprised of a time, followed by the raw count for each axis (x, y, and z respectively). - Select Save or Save As from the File menu to save the file. - Open the saved file using Excel. Calculate the average of the samples. This gives the noise of the accelerometer in raw counts. SensorCalc This application allows the user to test and calculate the zero-g offset and sensitivity parameters of the accelerometer. Once the accelerometer is properly placed relative to the Earth s gravity, simple mouse clicks initiate a series of test sequences that result in the display of raw-count data. SensorMap This application allows the user to read and write to specific registers of the accelerometer. The registers and their values are all displayed simultaneously on one color-coded grid. Page 11 of 12

The Kionix Advantage Kionix technology provides for X, Y, and Z-axis sensing while providing the ability to autonomously analyze sensor data on a single, silicon chip. One accelerometer can be used to enable a variety of simultaneous features including, but not limited to: Hard Disk Drive protection Vibration analysis Tilt screen navigation Sports modeling Theft, man-down, accident alarm Image stability, screen orientation & scrolling Game playing Automatic sleep mode Theory of Operation Kionix MEMS linear tri-axis accelerometers function on the principle of differential capacitance. Acceleration causes displacement of a silicon structure resulting in a change in capacitance. A signalconditioning CMOS technology ASIC detects and transforms changes in capacitance into an analog output voltage, which is proportional to acceleration. These outputs can then be sent to a microcontroller for integration into various applications. For product summaries, specifications, and schematics, please refer to the Kionix MEMS accelerometer product sheets at http://www.kionix.com/sensors/accelerometer-products.php. Page 12 of 12