Controls/MCUs??
A compact algorithm using the ADXL213 duty cycle output
Keywords:compact algorithm ADXL213? pulse width? tilt? decode algorithm?
In many applications, high accuracy measurement of acceleration is less important than having a simple and compact software algorithm. This application note outlines a decode algorithm that measures only the pulse width (t1) output of the ADXL213 and translates it to degrees of tilt. In this algorithm, the period (t2) is not measured, and no binary division is used.
In PIC assembly code, a total of 199bytes of program memory and 18bytes of data memory are used. Even more efficient memory usage (particularly of data memory) can be obtained with further optimization. A flowchart of the algorithm is included so that the user can modify it or port it to any 4bit or 8bit MCU with little effort. A discussion of error sources inherent in this method of measurement is also included.
View the PDF document for more information.
Click here to view related datasheets.
Article Comments - A compact algorithm using the ADXL21...
Visitor(To avoid code verification, simply login or register with us. It is fast and free!)
?
Top Ranked Articles
?
Webinars
Visit Asia Webinars to learn about the latest in technology and get practical design tips.