ohahaha

CN0133

Detecting low-g acceleration using the ADuC7024 precision analog microcontroller and the ADXL345 digital accelerometer

 
Overview

Circuit functions and advantages

The ADXL345 is a small, thin, low-power, three-axis accelerometer that provides high-resolution (13-bit) measurements of acceleration up to ±16 g. Digital output data is in 16-bit two's complement format and can be accessed via the SPI (3-wire or 4-wire) or I 2 C digital interface.

The ADXL345 is ideally suited for mobile device applications. It can measure static acceleration due to gravity in tilt detection applications, as well as dynamic acceleration caused by motion or impact. It has high resolution (4 mg/LSB) and is capable of measuring tilt changes of approximately 0.25°. Using a digital output accelerometer like the ADXL345 eliminates the need for analog-to-digital conversion, saving system cost and board area. In addition, the ADXL345 has multiple built-in features. Activity/inactivity detection, single-click/double-click detection, and free-fall detection are all done internally without requiring the host processor to perform any calculations. The built-in 32-level FIFO storage buffer can reduce the burden on the host processor, simplify algorithms and save power. The system can further save power by taking advantage of the built-in activity/inactivity detection function and using the ADXL345 as a "motion switch" (turning off the entire system when there is no activity and turning it on when activity is detected). The ADXL345 communicates

via I2 or SPI interface. The circuit described in this article demonstrates how to communicate via these protocols.



Figure 1. 4-wire SPI configuration for ADXL345 and ADuC7024 (schematic diagram, decoupling and all connections not shown)

 




Figure 2. I 2 C configuration for ADXL345 and ADuC7024 (schematic diagram, decoupling and all connections not shown)

Circuit description

This circuit uses the ADuC7024 precision analog microcontroller with the ADXL345 digital accelerometer. Both devices support I 2 C and SPI interfaces. Figure 1 shows the SPI configuration of the ADXL345 and ADuC7024, and Figure 2 shows the I 2 C configuration of these devices. The CS pin (pin 7 of the ADXL345) is used to select the desired interface. If the CS pin is tied high (V DD I/O ), I 2 C mode is enabled. In SPI mode, the CS level switches at the beginning and end of each transfer. If CS is pulled high, it indicates that no SPI transfer is occurring, or that an I 2 C transfer may occur.

The schematics shown are schematic but show the necessary connections (power, ground, etc.). In these schematics, the ADuC7024 is programmed via the UART (connected to pin 49 and pin 50). SW2 and SW3 are reset and download buttons respectively, used for microcontroller programming. SW1 is the power switch.

For information on programming the ADuC7024, please refer to the ADuC7024 data sheet . For sample code for I2C configuration, please visit: http://www.analog.com/static/imported-files/circuit_notes/CN0133_Source_Code.zip.

参考设计图片
×

Blockdiagram

 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-18 21:54:44

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号