a ADXL202 Evaluation Board with RS-232 - G

advertisement
a
ADXL202 Evaluation Board with
RS-232 Interface and Datalogging.
ADXL202EB-232A
FEATURES
Evaluation board with ADXL202, Microchip
16C63
Two axis acquisition of acceleration or tilt
information
PC Data acquisition software
275Hz Max Sample Rate (PC dependent)
Powered from RS-232 Port
Datalogging Capability
IC socket location for verifying ADXL202
devices
GENERAL DESCRIPTION
The ADXL202EB-232A is an evaluation board for
the ADXL202 dual axis, 2 g accelerometer. The
board demonstrates the ADXL202 interface to a low
cost microcontroller, the Microchip 16C63, and is
configured to read the PWM signals from the
ADXL202, process them and convert them to a
serial protocol for communication to a PC RS-232
port. Software is provided to read the RS-232 port
and display real time acceleration data. A data
logging feature is also included, so that data can be
stored for later evaluation by a spreadsheet or other
tool.
The evaluation board is designed specifically to help
the designer understand accelerometers and
specifically how the ADXL202 may work in the
application, without the need to design HW or SW.
APPLICATIONS
• Development of New Applications
• Computer Peripherals
• Earthquake detectors
• Alarms and motion detectors
• Battery powered motion sensing
• 2 Axis tilt sensing with faster response than
electrolytic, mercury or thermal sensors
• Datalogging
• Instrumentation
The firmware for the Microchip microcontroller and
recommended firmware for other microcontrollers is
available for free on the Analog Devices Website,
(www.analog.com/imems/). This product is meant
as an evaluation board. Therefore, you may find the
board/software combination unsuitable for all
applications, such as FFT vibration analysis or
precise time histories. This is a limitation of the
evaluation
software,
not
the
ADXL202
accelerometer.
8/4/99, Rev. C
DETAILED DESCRIPTION
The ADXL202EB-232A is a dual axis RS-232
output digital accelerometer. The ADXL202EB-232
consists of the ADXL202JQC and the Microchip
16C63 microcontroller. The ADXL202 digital
outputs are read using the timer / counter port of the
microcontroller. The signals are converted from
high and low times to a duty cycle in %. The X and
Y duty cycle values are sent when requested. The
board is powered by an extra control signal, RTS, on
the RS-232 port. The voltage regulator is the low
power ADM666.
J1
Primary Connector, Serial Port Cable
Plugs into J1
1
Power In - 6-12 Vdc unregulated, connected
to RTS line of serial port
Transmit Data / RS-232 Out
Receive Data / RS-232 In
No Connect (Key)
Ground
2
3
4
5
J2
Secondary Connector, Analog and PWM
signals
1
2
3
4
5
6
Power In - 6 - 12 Vdc
XFILT
YFILT
XOUT
YOUT
Ground
J3
ADXL202 Self Test (short pins 1 & 2 to
activate the selftest mode)
SelfTest Input
Vcc
1
2
SOFTWARE INSTALLATION
The product works on any Win3.1,Win95, Win98 or
NT computer. The software is contained in a selfextractable zip file. Installation instructions are
provided in a read-me file on the included CD ROM.
Note that the software is also available on the
Analog
Devices
website
at
www.analog.com/imems/.
HARDWARE INSTALLATION
Connect the RS-232 cable to an available RS-232
COM port on your PC. Connect the demo board to
the cable via the connector. The notch on the
connector is pin 1 and should plug into J1. The
cable is keyed to prevent the user from plugging it
into the demo board incorrectly.
Demo Board LED
The LED on the demo board should blink 5 times
when it is connected to the serial communication
port. This indicates that the demo board has powerup, passed the initialization routines and is ready to
begin communication with the host software. If this
doesn’t happen press the reset button. If there is still
a problem please see the troubleshooting section.
Software SET UP
Running X-Analyze.
Run the X-Analyze program supplied on the CDROM, 1.) Double clicking on the file name in the
Explore window
2.) Select the program from the start menu
2.) Select Run... from the start menu and type or
select the program.
Add a Connection
To start, click on add a connection. If this is the first
time you will only see “New connection”. Click on
Select. Select a com port and the ADXL202EB232A. Click Select.
If this is not the first time, then you will see a list of
previously defined connections. Choose the one that
has the correct com port and the ADXL202EB232A.
If everything is ok, you will see a green LED appear
with the phrase “ADXL202-232A connect on
COMx. Connected at 38400 baud”. Where ‘x’ is
the number of the serial communication port that
was defined.
GRAPHS.
Click on one of the following icons; Line/Chart,
FFT, or Spirit Level to display the corresponding
graph.
Line Chart
The Line chart will show you the output of the X and
Y accelerometers in either % duty cycle or
acceleration in G’s. Using the drop down edit box
can change the amount of data that appears on the
graph. The amount of averaging can be changed
with the slide bar. The graph can be paused using
the pause/resume button on the lower right hand side
of the dialog box. The accelerometer can be zeroed
by pressing the zero button. This allows relative
measures to be performed.
FFT
The displayed parameter can either be the X or Y
acceleration in G.’s. The top trace is in the time
domain and the bottom graph is the frequency
response. The number of points to perform the FFT
on can be selected on the left side of the dialog box.
Spirit Level
The demo board can also be used as a tilt sensor that
this display demonstrates. The Roll axis is defined
to be the Ax axis and the Pitch axis is the Ay axis.
Holding the left mouse button while over the knob
will set the display range or by clicking on the
number and entering a value. For best results the
demo board should be calibrated prior to use.
CALIBRATION
Clicking on “Configure a Connection” allows the
user to modify the sensitivity and/or the 0-g value.
To automatically calibrate the sensitivity and the 0-g
value click on the “Calibrate” button. The software
calculates the sensitivity by the formula (Maximum Minimum)/2 where the Maximum and Minimum are
the maximum and minimum values seen per axis as
the demo board is rotated around. The 0-g value is
calculated by taking the average value of the
Maximum and Minimum values seen, (Maximum +
Minimum)/2. Care should be taken in rotating the
demo board in a smooth fashion. For best results the
demo board should be calibrated before each use.
maximum sample rate or a fixed sample rate. The
fixed sample rate must be at a rate the host computer
can sustain. To get the highest sampling rate, make
sure that the X-Analyze software is the only program
running and all other unnecessary programs has
been closed. Because of limitations in the XAnalyze software and the Windows O.S. fixed rate
sampling can typically only be done at less than 60%
of maximum sample rate if the Update Rate is set to
“as fast as possible.”
Data Logging
To save the values to a file click on the “Log all
Connections” button. To stop data logging click on
“Stop Logging” button. Note the button will toggle
between “Log all connections” and “Stop Logging”
depending if data logging is active or not. Open the
Configure a connection window to specify the file
name, location and logging rate.
If constant
sampling is required, the best approach would be to
save the samples to a file and then perform post
processing. Also close any unused programs and
eliminate any screen or mouse activity. To get the
best constant rate, set the datalogging rate and the
update rate to the same value. Note: On occasion,
missing samples might be noticed, this is a
limitation in the X-Analyze software and Windows
O.S. There has been much work to reduce, but not
completely eliminate the problem.
Averaging
Software averaging improves the noise rejection,
however it reduces how quickly the accelerometer
can respond to changes. Adjust the setting to the
application requirements. The default setting is 5
averages.
COMMUNICATIONS PROTOCOLS
The default RS-232 parameters are 38400 baud, 8
data bits, 1 start bit, no stop bits. The RS-232
protocol consists of a single ASCII command ‘G’
which returns a 4 byte data packet. The data packet
consists of 2 bytes each of X-axis and Y-axis duty
cycle data. See Tables 1,2, and 3.
Table 1: Data Commands
ASCII Decimal/(Hex)
G
71/(0x47)
Description
Request data
Table 2: Packet Structure
Sampling Rate
The sampling rate is the rate of which the demo
board is sending data. To set the sampling rate click
on “Configure a connection”. One can either set the
Byte Number
1
2
3
Value
0-255
0-255
0-255
Description
X Axis MSB
X Axis LSB
Y Axis MSB
4
0-255
Y Axis LSB
Table 3: Data Encoding
PWM % = (256 * MSB + LSB) / 100.0
COMPONENTS
The demo board consists of an ADXL202
accelerometer, a 16C63 Microchip microcontroller,
an ADM666 for voltage regulation of the RS-232
RTS signal, an ADM232 for RS232 interface, and a
crystal. Note that many of these components are
required only to support the RS-232 interface. In a
stand-alone, (non-232) board, often only the
ADXL202 and the Microchip controller will be
necessary.
RSET Resistor
To change the PWM frequency, the resistor labeled
R6 can be changed. Also there is a through-hole
resistor location RSET. Note: since R6 and RSET
are in parallel, one should only place a resistor in
only one of the locations. Please consult the Analog
Devices ADXL202 datasheet for values. The default
value of R6 sets the PWM frequency to 2.0KHz
X CAP/Y CAP Capacitors
The analog filtering for the X and Y accelerometers
are set by C15 and C11 respectively. There are
through-hole capacitors locations labeled X CAP and
Y CAP. Note: Since the pairs C15, X CAP and
C11, Y CAP are in parallel, one should only place
capacitors in one of the paired locations. Please
consult the Analog Devices ADXL202 datasheet for
more specifics. The default values of C15 and C11
set the analog cut-off frequency to 106Hz for both
the X and Y accelerometers.
Troubleshooting
The ADXL202EB-232A is powered through your
computer's COM port using the DTS line. Some
computers do not supply enough power to the board.
Other computers require that the serial port is active
before the DTS line is forced high. If you do not see
the red LED flash on the board when you first plug it
into the serial port, this is most likely the problem.
To activate the com port, attempt to connect to the
com port through the software. After the connection
fails, press the reset button on the demo board, then
attempt to reconnect. If all else fails, try the board
on another computer.
If you do not get the "connected" button to turn
green on the evaluation software check the following
things:
• The correct COM port is selected. Try
switching the COM port setting on the software
to make sure.
• Press the Reset Button. Verify that the LED on
the demo board flashes.
Cannot get a consistent constant sampling rate:
• Close all other programs.
• Datalog to a file and then do post-processing.
• Set the datalog rate the same as the update rate.
Spirit Level display is showing NaN or showing
inconsistent results.
• Calibrate the demo board before using the Spirit
Level display
U2
2
VCC
1
7
VCC
+
C4
10uF
4
VOUT
8
VIN
SENSE
5
SHDN
LBO
LBI
GND
VSET
3
+
C7
10uF
6
D2
1N5819
ADM666A
+ C3
.33uF
10%
35V
U1
16
10
9
+ C8
.33uF
10%
35V
15
T_IN1
R_OUT1
TTL
2
6
VCC
T_IN0
R_OUT0
T_OUT1
R_IN1
232
11
12
T_OUT0
R_IN0
V+
V-
C1+
C1-
GND
C2+
C2-
7
8
J1
RTS_232
TX_232
RX_232
14
13
1
3
GND
VCC
4
5
+ C1
.33uF
10%
35V
ADM202JRN
+ C2
.33uF
10%
35V
1
2
3
4
5
1
2
3
4
5
HDR1X5X.1-RT
J2
L1
FERRITE BEAD
C16
VCC_ANG
VCC_IN
XCAP
YCAP
PWM_XOUT
PWM_YOUT
1
2
3
4
5
6
1
2
3
4
5
6
HDR1X6X.1
VCC
U4
.1uF
14
13
R1 FS THH 5%
R3
5.11K
RESET
SW1
PB SPST
1
C9
.015uF
R4
1.00K
2
3
4
5
6
7
X2
1
CHASSIS GND
R2
0
ADD FOR CONNECTING
GND TO CHASSIS
RA0
TICKI/RC0
RA1
CCP2/RC1
RA2
CCP1/RC2
RA3
SCK/RC3
RA4/TOCKI
SDI/RC4
RA5/SS
SDO/RC5
TX/RC6
RB0/INT
RX/RC7
RB1
RB2
RB3
RB4
RB5
RB6
RB7
OSC1/IN
21
22
23
24
25
26
27
28
9
R5
1.00K
3
5
R6 61.9K
MCLR/VPP
7
4
11
12
13
14
15
16
17
18
X CAP
C15
.047uF
10%
50V
C10
FSuF THH
C14
FSuF THH
C12
.1uF
VCC
X1
J3
2
1
1
2
3
4
5
6
7
2
1
HDR 2 X 1 X .1
R7 10.0M
Y1
R8
100K
9.8304MHZ
C18
22pF
Figure 1 schematic of ADXL202EB-232A demo board
1
2
3
4
5
6
7
14
13
12
11
10
9
8
TEST SKT
NOT INSTALLED
RED
C17
22pF
Y CAP
C11
.047uF
10%
50V
D1
Power-Up Indicator
Blinks 5x's
10
9
12
11
ADXL202
SENSOR TEST
OSC2/OUT
1
5
RSET
PIC16C63
10
2
3
4
U3
ACCEL
VCC1
VCC0 2-AXIS
2G
TEST
T2
XOUT
YOUT
GND1 XCAP
GND0 YCAP
14
13
12
11
10
9
8
VCC
C5
.1uF
C13
.1uF
C6
.1uF
Download