KXCJK AN 039. Getting Started with the KXCJK. Introduction

Similar documents
AN065. AN065 Getting Started with the KXTJ3. Introduction

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

AN 038. Getting Started with the KXTJ2. Introduction

AN 025 Getting Started with the KXTI9

AN049. Getting Started. 1. Introduction

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

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

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

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

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

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

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

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

MMA865xFC Sensor Toolbox User s Guide

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

Using the Xtrinsic FXLS8471CQ Transient-Acceleration Function

MMA845xQ Sensor Toolbox User s Guide

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.

± 2g Tri-axis Digital Accelerometer Specifications

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

Gyroscope Module 3-Axis L3G4200D (#27911)

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

MAG3110 Frequently Asked Questions

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

GENERAL DESCRIPTION MC3635 FEATURES

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

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

Compass Module 3-Axis HMC5883L (#29133)

Sensor Toolbox (Part 2): Inertial Sensors

Fully Integrated Thermal Accelerometer MXC6225XU

Product Family Specification

Application Guidelines for LIS3DSH State Machine

Parallax LSM9DS1 9-axis IMU Module (#28065)

Modern Robotics Inc. Sensor Documentation

OOB (1) Detection Module, With I 2 C Interface Accelerometer

AN-1025 APPLICATION NOTE

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

Embedded Algorithms for Motion Detection and Processing

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

MMA845x Driver: Quick Start Guide

2011 FIRST Robotics Competition Sensor Manual

GENERAL DESCRIPTION FEATURES. Range, Sampling & Power ±2g range 6,7, or 8-bit resolution to 128 samples/sec 46 to 115 μa typical active current

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

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

MC3635 FEATURES GENERAL DESCRIPTION

HOBO Pendant G Data Logger (UA ) White Paper

± 10g Tri-axis Accelerometer Specifications

Evaluation Board User Guide UG-047

Application Report. 1 Hardware Description. John Fahrenbruch... MSP430 Applications

AMS 5812 OEM pressure sensor with an analog and digital output

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

Skill Level: Beginner

MAKEVMA208 3-AXIS DIGITAL ACCELERATION SENSOR MODULE - MMA8452 USER MANUAL

BMM150 Geomagnetic Sensor

MPU-6000/MPU Axis Evaluation Board User Guide

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

± 2g Tri-axis Accelerometer Specifications

Enabling better device interaction with accelerometer

GMA301 ±6g Tri-Axial Digital Accelerometer

IST8301C 3D Magnetometer Sensor. Datasheet

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

± 2g Tri-Axis Accelerometer Specifications

Pressure 4 click. PID: MIKROE 3020 Weight: 24 g

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

Me 3-Axis Accelerometer and Gyro Sensor

IMU Axis Gyro Evaluation Board Application Note

MEMS Micro Joystick Specification Knowles Acoustics 1151 Maplewood Drive Itasca, IL 60143

Accelerometer with Analog and Digital I/O for StackableUSB USB1600

Color 7 click. PID: MIKROE 3062 Weight: 19 g

± 2g Tri-axis Accelerometer Specifications

1 Features. 2 Applications. 3 Description. USB Accelerometer Model X16-2

MMA8450Q. Freescale Semiconductor Technical Data An Energy Efficient Solution by Freescale 3-Axis, 8-bit/12-bit Digital Accelerometer

Emulating I2C Bus Master by using FlexIO

± 2g Tri-axis Accelerometer Specifications

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

Programmable Dual Axis Digital Accelerometer and Impact Sensor ADIS16204

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

GSDM110 Three-Axis Digital Magnetometer

I 2 C Application Note in Protocol B

User Manual Rev. 0. Freescale Semiconductor Inc. FRDMKL02ZUM

E and E firmware additional

MODEL SW6000 & SM6100 CENELEC INSTRUCTIONS

I Introduction to Real-time Applications By Prawat Nagvajara

User-configurable Resolution. 9 to 12 bits (0.5 C to C)

PAT9125EL: Optical Tracking Miniature Chip

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

Web Site: Forums: forums.parallax.com Sales: Technical:

XDK HARDWARE OVERVIEW

MMA8452Q Accelerometer Breakout Hookup Guide

Real-Life Augmentation of the Xbox Controller

GENERAL DESCRIPTION FEATURES

DIGITAL HUMIDITY SENSOR HYT-131

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

MMA7260QT. 3 Axis Accelerometer Module

GENERAL DESCRIPTION FEATURES

1 Features. 2 Applications. 3 Description. USB Accelerometer Model X6-2

DS1870 LDMOS BIAS CONTROLLER EV KIT

GENERAL DESCRIPTION FEATURES

CprE 288 Introduction to Embedded Systems (Timers/Input Capture) Instructors: Dr. Phillip Jones

Transcription:

Getting Started with the KXCJK Introduction This application note will help developers quickly implement proof-of-concept designs using the KXCJK tri-axis accelerometer. Please refer to the KXCJK data sheet for additional implementation guidelines. While Kionix strives to ensure that our accelerometers will meet design expectations by default, it is not possible to provide default settings to work in every environment. Depending on the intended application, it is very likely that some customization will be required in order to optimize performance. We hope the information provided here will help the developer get the most out of the KXCJK. Circuit Schematic This section shows recommended wiring for the KXCJK, based on proven operation of the part. Specific applications may require modifications from these recommendations. Please refer to the KXCJK Data Sheet for all pin descriptions. Vdd IO Vdd 1 16 15 14 13 C 1 C 2 2 3 KXCJK 12 11 INT SCL 4 10 5 6 7 8 9 SDA ADDR Figure 1. 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 7

Quick Start Implementation Here we present two basic ways to initialize the part. These can vary based on desired operation, but generally the initial operations a developer wants to do are: 1) read back acceleration data, and 2) activate the wake-up function. These cursory solutions are provided as a means for configuring the part to a known operational state. Note that these conditions just provide a starting point, and the values may vary as developers refine their application requirements. 1- Read Back Acceleration Data - Write 0xC0 to Control Register 1 to assert PC1 (Power Control bit), set the G-range to +/-2g, and set the resolution to 12 bits. Address Value Register Name Hex Binary Hex Binary CTRL_REG1 0x1B 0001 1011 0xC0 1100 0000 - Acceleration data can now be read from the XOUT, YOUT, and ZOUT registers. 2- Activate Wake-Up Function - Write 0x07 to Control Register 2 to set the ODR (output data rate) for wake up funtion to 100 Hz. - Write 0x0A to Wakeup Timer to set the amount of time a motion must be present (100 ms) before a wake up is triggered. Here we assume that any axis or direction can trigger a wake up interrupt (INT_CTRL_REG2 default). - Write 0x04 to Wakeup Threshold to set the motion threshold to 0.250 g. - Write 0x38 to Interrupt Control Register 1 to reflect the wakeup interrupt on a physical pin. The interrupt pin is active high and in pulse mode (a single pulse is transmitted when motion interrupt occurs) - Write 0xC2 to Control Register 1 to assert PC1 (Power Control bit), set the G-range to +/-2g, set the resolution to 12 bits, and enable the wake-up function. - Register Name Address Value Hex Binary Hex Binary CTRL_REG2 0x1D 0001 1101 0x07 0000 0111 WAKEUP_TIMER 0x29 0010 1001 0x0A 0000 1010 WAKEUP_THRESHOLD 0x6A 0110 1010 0x04 0000 0100 INT_CTRL_REG1 0x1E 0001 1110 0x38 0011 1000 CTRL_REG1 0x1B 0001 1011 0xC2 1100 0010 - Changes to wakeup state will now be reflected in bit 4 of STATUS_REG (INT bit), bit 1 of INT_SRC_REG1 (WUFS bit), and also on the physical interrupt pin. Timing Requirements There are several timing requirements that developers should keep in mind when working with the KXCJK. I²C Clock - The I²C Clock can be up to 3.4MHz. Power Up to Communication - After the part is powered up, it takes 30ms before it is ready for I²C communication. Enable to Valid Outputs - The timing from PC1 bit in Control Register 1 being asserted to valid acceleration outputs is dependent on ODR. Please refer to the table below for start-up timings. Page 2 of 7

Start Up Time Parameters Units Min Typical Max RES = 0 0.781Hz 12.5Hz 50Hz 200Hz 800Hz 1600Hz ms 2 1200 81 21 6 2.5 2 Accelerometer Placement and Orientation Placement It is important to note that the placement of the accelerometer within the target device can have a significant effect on tap/double-tap direction resolution. If tap detection is desired, the part should be placed as far away from the edges of the device housing as possible, with the ideal location being at the target device s center of mass. Orientation While it is recommended to align the accelerometer s axes with those of the target device, it will sometimes be desirable or necessary to alter the part s orientation with respect to the device housing. Rotating about the Z axis at intervals of 90 degrees or about the X or Y axes at intervals of 180 degrees should not impact functionality. However, it is highly recommended that the device is not rotated 90 or 270 degrees about the X or Y axes. Due to the asymmetrical nature of the tilt position function, altering the orientation of the Z axis in this manner can cause incorrect screen rotation direction resolution. Interrupt Configuration The physical interrupt has 8 possible configurations, based on two states for each of the three customizable variables located in Interrupt Control Register 1: Latched/Pulsed (IEL bit 3 0x08) 0 Latched mode When an interrupt is triggered, it will remain active on the pin until cleared. 1 Pulse mode When an interrupt is triggered, it will cause a short (~50µs) pulse on the pin and clear itself. Polarity (IEA bit 4 0x10) 0 Active Low The interrupt pin will normally be HIGH, but will transition to LOW when an interrupt is triggered. 1 Active High The interrupt pin will normally be LOW, but will transition to HIGH when an interrupt is triggered. Enable/Disable (IEN bit 5 0x20) 0 Disabled Interrupt conditions will not be reflected on the physical interrupt pin. 1 Enabled Interrupt conditions will be reflected on the physical interrupt pin. Page 3 of 7

A Few Interrupt Tips Read the Interrupt Release Register to Clear In latched mode, the INT_REL register must be read in order to clear the physical interrupt pin. This will also clear the Interrupt Source Registers (1 and 2) and the INT bit (0x10) in the Status Register. Microcontroller/GPIO Interrupt Handling GPIO configuration is based solely on the connected hardware. The KXCJK can be configured to issue interrupts depending on how the GPIO is programmed to catch them (if this is not the case, please contact your Kionix Sales Representative). Generally, when an interrupt is triggered, the developer should take the following steps: 1- Disable GPIO interrupt 2- Clear GPIO interrupt and generate desired functionality 3- Enable GPIO interrupt These steps should be taken without calling any I2C transactions if done in an interrupt context, because the operating system or kernel will not allow busy-waiting on an I/O operation during an interrupt service routine. Interrupt Polling - If physical interrupts are not used, a polling mechanism can be devised, which checks the INT bit in STATUS_REG. This mechanism should then look at INT_SRC_REG1 to determine which caused the interrupt and what steps should be taken before clearing the interrupt source information by reading the INT_REL register. Digital Engine Operation Motion Detection The Wake Up Function generates an interrupt when the part transitions from an inactive to an active state, as determined by the WUF_TIMER and WUF_THRESH register values. If the interrupt is configured in unlatched mode, it will be de-asserted when the part transitions from an active to an inactive state. Axis Masking - It is possible to mask all wake-up events including the direction which occur on a particular axis (or axes). This is done with the 6 bits: XNWUE, XPWUE, YNWUE, YPWUE ZNWUE, and ZPWUE in Interrupt Control Register 1. XNWU - x negative (x-): 0 = disabled, 1 = enabled XPWU - x positive (x+): 0 = disabled, 1 = enabled YNWU - y negative (y-): 0 = disabled, 1 = enabled YPWU - y positive (y+): 0 = disabled, 1 = enabled ZNWU - z negative (z-): 0 = disabled, 1 = enabled ZPWU - z positive (z+): 0 = disabled, 1 = enabled Page 4 of 7

Timers and Thresholds WUF (Wake Up Function) Timer This timer establishes the number of ODR cycles that the acceleration on an unmasked axis must be above the WUF threshold before a wake up interrupt is triggered. Each count in this register equals one Motion Detection ODR cycle, as dictated by the OWUFA, OWUFB and OWUFC bits in Control Register 2. WUF Threshold This threshold determines how much acceleration is required in an unmasked axis in order to trigger a wake up interrupt that causes the part to transition from inactivity to activity. Troubleshooting All Interrupt Issues - Make sure the KXCJK 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. - Double check the Wake Up Mask bits in Interrupt Control Register 2. - The WUF Timer is based on the respective Output Data Rates, so make sure the correct cycle time is used when calculating the expected timer length (please refer to the KXCJK product specification). WUF (Wake Up Function) Interrupt Not Working - Make sure that the WUF engine is enabled (WUFE bit in Control Register 1). - Try altering the threshold requirements to achieve desired operation. If the part is waking up too easily, try increasing the threshold. If the interrupt is not firing at all, the threshold may be set too high. - Try shortening the timer requirements, and make sure the acceleration on an unmasked axis is above the threshold until the expiration of the WUF Timer. 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 KXCJK. 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 users 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. Page 5 of 7

- 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. Motion This utility allows the user to test whether the accelerometer has detected motion on any of the axes. Options are available to change the resolution (8-bit or 12-bit), output data rate, high-pass filter settings, WUF_THRESH and WUF_TIMER register values, or mask any of the axes. Page 6 of 7

The Kionix Advantage Kionix technology provides for X, Y, and Z-axis sensing 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 Computer pointer Navigation, mapping 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 7 of 7