代做MICROCONTROLLER PROGRAMMING代做留学生SQL语言

2024-12-12 代做MICROCONTROLLER PROGRAMMING代做留学生SQL语言

MICROCONTROLLER PROGRAMMING

DIGITAL SEISMOMETER

Peak Ground Acceleration (PGA) is a measure of the severity of an earthquake.  The magnitude 9 Tohoku quake of 2011 had a PGA of 2.99g.  Earthquake shaking generally occurs in all three directions (PGA is often split into the horizontal and vertical components) and the 3-axis data is important for earthquake engineering.  Damage to buildings and infrastructure is related more closely to ground motion, of which PGA is a measure, rather than the magnitude of the earthquake itself.

A digital seismometer is to be designed that measures 3-axis accelerations and transmits that data over a serial interface to a desktop personal computer.

The specification of the 3-axis accelerometer to be used is given in Table 1.

Supply voltage

Range

Offset (0g voltage)

Sensitivity

5 V

+/-5 g

2.5 V

0.5 V/g

The sensor provides 3 analogue outputs each of whose voltage is directly proportional to acceleration in each of 3 axes. The microcontroller to be used is the C167, and each of the 3 analogue voltages needs to be connected to 3 channels of the C167’s ADC. The serial port of the  C167 is to be used to stream the acceleration data as ASCII text with 2 decimal places. A comma should separate each axis and a set of 3 readings should be followed by a ‘carriage return’ character (ASCII code 13 decimal):

E.g.:

1.10,1.34,-0.84

-1.24,0.65,1.22

In order to minimize time skew between the 3 individual axis readings each set of 3 readings should be converted as fast as possible.  The data needs to be transmitted before the next set of readings. There should be 0.1s between subsequent sets of readings and this process should be repeated continuously.

To be submitted online:

Brief report.  The report is to be a properly structured engineering report, typed and should explain how your program works. Wherever appropriate, please make use of flowcharts, pseudo code, state diagrams etc. to document the algorithmic details of your program. Also include Keil Simulator screenshots showing the correct operation of your Seismometer.

The report and project files (zipped) with fully commented source code should be emailed to [email protected].  Use your student ID as the filename and in the header of the main program (as comment).

Maintain a modular file structure, i.e. keep all Timer related functions in source file timer.c with prototypes exported through timer.h, etc.