5
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. 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. 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 8/4/99, Rev. C

a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

Embed Size (px)

Citation preview

Page 1: a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

a ADXL202 Evaluation Board withRS-232 Interface and Datalogging.

ADXL202EB-232A

FEATURESEvaluation board with ADXL202, Microchip16C63Two axis acquisition of acceleration or tiltinformationPC Data acquisition software275Hz Max Sample Rate (PC dependent)Powered from RS-232 PortDatalogging CapabilityIC socket location for verifying ADXL202devices

GENERAL DESCRIPTIONThe ADXL202EB-232A is an evaluation board forthe ADXL202 dual axis, 2 g accelerometer. Theboard demonstrates the ADXL202 interface to a lowcost microcontroller, the Microchip 16C63, and isconfigured to read the PWM signals from theADXL202, process them and convert them to aserial protocol for communication to a PC RS-232port. Software is provided to read the RS-232 portand display real time acceleration data. A datalogging feature is also included, so that data can bestored for later evaluation by a spreadsheet or othertool.

The evaluation board is designed specifically to helpthe designer understand accelerometers andspecifically how the ADXL202 may work in theapplication, without the need to design HW or SW.

The firmware for the Microchip microcontroller and recommended firmware for other microcontrollers isavailable for free on the Analog Devices Website,(www.analog.com/imems/). This product is meantas an evaluation board. Therefore, you may find theboard/software combination unsuitable for allapplications, such as FFT vibration analysis orprecise time histories. This is a limitation of theevaluation software, not the ADXL202accelerometer.

APPLICATIONS• Development of New Applications

• Computer Peripherals• Earthquake detectors• Alarms and motion detectors• Battery powered motion sensing

• 2 Axis tilt sensing with faster response thanelectrolytic, mercury or thermal sensors

• Datalogging• Instrumentation

8/4/99, Rev. C

Page 2: a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

DETAILED DESCRIPTIONThe ADXL202EB-232A is a dual axis RS-232output digital accelerometer. The ADXL202EB-232consists of the ADXL202JQC and the Microchip16C63 microcontroller. The ADXL202 digitaloutputs are read using the timer / counter port of themicrocontroller. The signals are converted fromhigh and low times to a duty cycle in %. The X andY duty cycle values are sent when requested. Theboard is powered by an extra control signal, RTS, onthe RS-232 port. The voltage regulator is the lowpower ADM666.

J1 Primary Connector, Serial Port CablePlugs into J1

1 Power In - 6-12 Vdc unregulated, connectedto RTS line of serial port

2 Transmit Data / RS-232 Out3 Receive Data / RS-232 In4 No Connect (Key)5 Ground

J2 Secondary Connector, Analog and PWMsignals

1 Power In - 6 - 12 Vdc2 XFILT3 YFILT4 XOUT5 YOUT6 Ground

J3 ADXL202 Self Test (short pins 1 & 2 toactivate the selftest mode)

1 SelfTest Input2 Vcc

SOFTWARE INSTALLATIONThe product works on any Win3.1,Win95, Win98 orNT computer. The software is contained in a self-extractable zip file. Installation instructions areprovided in a read-me file on the included CD ROM.Note that the software is also available on theAnalog Devices website atwww.analog.com/imems/.

HARDWARE INSTALLATIONConnect the RS-232 cable to an available RS-232COM port on your PC. Connect the demo board tothe cable via the connector. The notch on theconnector is pin 1 and should plug into J1. Thecable is keyed to prevent the user from plugging itinto the demo board incorrectly.

Demo Board LEDThe LED on the demo board should blink 5 timeswhen it is connected to the serial communicationport. This indicates that the demo board has power-up, passed the initialization routines and is ready tobegin communication with the host software. If thisdoesn’t happen press the reset button. If there is stilla problem please see the troubleshooting section.

Software SET UP

Running X-Analyze.Run the X-Analyze program supplied on the CD-ROM, 1.) Double clicking on the file name in theExplore window2.) Select the program from the start menu2.) Select Run... from the start menu and type orselect the program.

Add a ConnectionTo start, click on add a connection. If this is the firsttime you will only see “New connection”. Click onSelect. Select a com port and the ADXL202EB-232A. Click Select.

If this is not the first time, then you will see a list ofpreviously defined connections. Choose the one thathas the correct com port and the ADXL202EB-232A.

If everything is ok, you will see a green LED appearwith the phrase “ADXL202-232A connect onCOMx. Connected at 38400 baud”. Where ‘x’ isthe number of the serial communication port thatwas defined.

Page 3: a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

GRAPHS.

Click on one of the following icons; Line/Chart,FFT, or Spirit Level to display the correspondinggraph.

Line ChartThe Line chart will show you the output of the X andY accelerometers in either % duty cycle oracceleration in G’s. Using the drop down edit boxcan change the amount of data that appears on thegraph. The amount of averaging can be changedwith the slide bar. The graph can be paused usingthe pause/resume button on the lower right hand sideof the dialog box. The accelerometer can be zeroedby pressing the zero button. This allows relativemeasures to be performed.

FFTThe displayed parameter can either be the X or Yacceleration in G.’s. The top trace is in the timedomain and the bottom graph is the frequencyresponse. The number of points to perform the FFTon can be selected on the left side of the dialog box.

Spirit LevelThe demo board can also be used as a tilt sensor thatthis display demonstrates. The Roll axis is definedto be the Ax axis and the Pitch axis is the Ay axis.Holding the left mouse button while over the knobwill set the display range or by clicking on thenumber and entering a value. For best results thedemo board should be calibrated prior to use.

CALIBRATIONClicking on “Configure a Connection” allows theuser to modify the sensitivity and/or the 0-g value.To automatically calibrate the sensitivity and the 0-gvalue click on the “Calibrate” button. The softwarecalculates the sensitivity by the formula (Maximum -Minimum)/2 where the Maximum and Minimum arethe maximum and minimum values seen per axis asthe demo board is rotated around. The 0-g value iscalculated by taking the average value of theMaximum and Minimum values seen, (Maximum +Minimum)/2. Care should be taken in rotating thedemo board in a smooth fashion. For best results thedemo board should be calibrated before each use.

Sampling RateThe sampling rate is the rate of which the demoboard is sending data. To set the sampling rate clickon “Configure a connection”. One can either set the

maximum sample rate or a fixed sample rate. Thefixed sample rate must be at a rate the host computercan sustain. To get the highest sampling rate, makesure that the X-Analyze software is the only programrunning and all other unnecessary programs hasbeen closed. Because of limitations in the X-Analyze software and the Windows O.S. fixed ratesampling 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 LoggingTo save the values to a file click on the “Log allConnections” button. To stop data logging click on“Stop Logging” button. Note the button will togglebetween “Log all connections” and “Stop Logging”depending if data logging is active or not. Open theConfigure a connection window to specify the filename, location and logging rate. If constantsampling is required, the best approach would be tosave the samples to a file and then perform postprocessing. Also close any unused programs andeliminate any screen or mouse activity. To get thebest constant rate, set the datalogging rate and theupdate rate to the same value. Note: On occasion,missing samples might be noticed, this is alimitation in the X-Analyze software and WindowsO.S. There has been much work to reduce, but notcompletely eliminate the problem.

AveragingSoftware averaging improves the noise rejection,however it reduces how quickly the accelerometercan respond to changes. Adjust the setting to theapplication requirements. The default setting is 5averages.

COMMUNICATIONS PROTOCOLSThe default RS-232 parameters are 38400 baud, 8data bits, 1 start bit, no stop bits. The RS-232protocol consists of a single ASCII command ‘G’which returns a 4 byte data packet. The data packetconsists of 2 bytes each of X-axis and Y-axis dutycycle data. See Tables 1,2, and 3.

Table 1: Data CommandsASCII Decimal/(Hex) DescriptionG 71/(0x47) Request data

Table 2: Packet Structure

Byte Number Value Description1 0-255 X Axis MSB2 0-255 X Axis LSB3 0-255 Y Axis MSB

Page 4: a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

4 0-255 Y Axis LSB

Table 3: Data Encoding

PWM % = (256 * MSB + LSB) / 100.0

COMPONENTSThe demo board consists of an ADXL202accelerometer, a 16C63 Microchip microcontroller,an ADM666 for voltage regulation of the RS-232RTS signal, an ADM232 for RS232 interface, and acrystal. Note that many of these components arerequired only to support the RS-232 interface. In astand-alone, (non-232) board, often only theADXL202 and the Microchip controller will benecessary.

RSET ResistorTo change the PWM frequency, the resistor labeledR6 can be changed. Also there is a through-holeresistor location RSET. Note: since R6 and RSETare in parallel, one should only place a resistor inonly one of the locations. Please consult the AnalogDevices ADXL202 datasheet for values. The defaultvalue of R6 sets the PWM frequency to 2.0KHz

X CAP/Y CAP Capacitors

The analog filtering for the X and Y accelerometersare set by C15 and C11 respectively. There arethrough-hole capacitors locations labeled X CAP andY CAP. Note: Since the pairs C15, X CAP andC11, Y CAP are in parallel, one should only placecapacitors in one of the paired locations. Pleaseconsult the Analog Devices ADXL202 datasheet formore specifics. The default values of C15 and C11

set the analog cut-off frequency to 106Hz for boththe X and Y accelerometers.

TroubleshootingThe ADXL202EB-232A is powered through yourcomputer's COM port using the DTS line. Somecomputers do not supply enough power to the board.Other computers require that the serial port is activebefore the DTS line is forced high. If you do not seethe red LED flash on the board when you first plug itinto the serial port, this is most likely the problem.To activate the com port, attempt to connect to thecom port through the software. After the connectionfails, press the reset button on the demo board, thenattempt to reconnect. If all else fails, try the boardon another computer.

If you do not get the "connected" button to turngreen on the evaluation software check the followingthings:• The correct COM port is selected. Try

switching the COM port setting on the softwareto make sure.

• Press the Reset Button. Verify that the LED onthe 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 showinginconsistent results.• Calibrate the demo board before using the Spirit

Level display

Page 5: a ADX L202 Evaluation Board with RS-232 Interface and ... · RS-232 Interface and Datalogging. ADXL202EB-232 A FEATURES Evaluation board with ADXL202, Microchip 16C63 ... with the

VCC

VCC

VCC

VCC

VCC

VCC

GND

TX_232RX_232

VCC_IN

PWM_XOUT

RTS_232

XCAPYCAP

PWM_YOUT

VCC_ANG

D1

RED

C14FSuF THH

C10FSuF THH

SW1

PB SPST

1253

4

C1722pF

C1822pF

+ C3.33uF10%35V

+ C2.33uF10%35V

+ C8.33uF10%35V

+ C1.33uF10%35V

X2

CHASSIS GND

1

Y1

9.8304MHZ

R35.11K

R8100K

R51.00K

C9.015uF

C16

.1uF

C6.1uF

TTL

232

U1

ADM202JRN

123

45

6

13

16

15

141112

789

10

C1+V+C1-

C2+C2-

V-

R_IN0

VCC

GND

T_OUT0T_IN0R_OUT0

T_OUT1R_IN1R_OUT1

T_IN1

C12

.1uF

R1 FS THH 5%ACCEL2-AXIS2G

U4

ADXL202

4

10

14

912

13

7

5

11

3

GND0

XOUT

VCC1

YOUTXCAP

VCC0

GND1

T2

YCAP

TEST

R41.00K

L1FERRITE BEAD

J2

HDR1X6X.1

1234

65

1234

65

R7 10.0M

D2

1N5819

+ C710uF+ C4

10uF

J1

HDR1X5X.1-RT

12345

12345

R6 61.9K

X1

TEST SKT

1234567 8

91011121314

1234567 8

91011121314

C11.047uF

50V10%

U2

ADM666A

1

2

3

4

5

6

7

8

SENSE

VOUT

LBI

GND

SHDN

VSET

LBO

VIN

C15.047uF

50V10%

C13.1uF

C5.1uF

J3

HDR 2 X 1 X .1

12

12

R20

U3 PIC16C63

1

234567

2122232425262728

1112131415161718

9 10

MCLR/VPP

RA0RA1RA2RA3RA4/TOCKIRA5/SS

RB0/INTRB1RB2RB3RB4RB5RB6RB7

TICKI/RC0CCP2/RC1CCP1/RC2

SCK/RC3SDI/RC4

SDO/RC5TX/RC6RX/RC7

OSC

1/IN

OSC

2/O

UT

RESET

SENSOR TEST

NOT INSTALLEDPower-Up IndicatorBlinks 5x's

ADD FOR CONNECTINGGND TO CHASSIS

RSETY CAP X CAP

Figure 1 schematic of ADXL202EB-232A demo board