Show the software that goes in the ram uninitialized on


The objective of this problem is to design a DAS alarm. An alarm should sound when noise is present in the room. Assume the output of the microphone, x(t), is a ±10 mV differential signal. The signals of interest are 100 to 500 Hz. You will sample the sound and calculate the sound energy once a second (sum of the signal squared). Be careful to subtract off the DC so that a quiet room (microphone = 0) results in an energy calculation of zero. If data are the 8-bit ADC, then x(n) = data - 128 represent the current 8-bit signed sample. If you sample at 1000 Hz, sound the alarm if (x(0) + x(1)+ . . . + x (999)) greater than 100,000. 32-bit-long integer operations are allowed. The 9S12 system has an 8-MHz E clock. The alarm can be activated by driving 20 mA through a 5-V EM relay. The software should turn on the alarm if the energy level is above a threshold (simply pick any constant). Once on, the alarm should continue until the operator types the code "213" on the keypad. This 9S12 will have a secret code of 213, but allow each 9S12 to have a different three-number code and a different threshold. The computer is dedicated to this task.

a) Show the analog interface between the differential microphone output and the 9S12 ADC channel 2. Choose the appropriate op amp circuit, gain, offset, and analog filter. The Analog Devices AD680 is a three-wire, low-cost, 2.5 V reference (+5 V input, ground +2.500 V output). This is a qualitative, and not a quantitative, DAS.

Design the interface between the 9S12 signal B0 and the EM relay (Figure 12.62). To activate the alarm, the relay coil requires a voltage between +3.5 and 6.0 V and a current of 20 mA.

Figure 12.62

1698_943e3fdd-d867-449b-a0d3-bcd2e312ef40.png

c) Show the interface between the keypad and the 9S12 (Figure 12.63). Each switch will bounce for about 10 ms, so you must implement a way to debounce. No other 9S12 connections may be used for this interface (although you may use the internal features of input capture/output compare). Your solution should minimize cost. Periodic polling should be used for this keypad because it is cheaper.

Figure 12.63

641_564dc71e-642c-4404-87eb-9ebad40ddeaf.png

d) Include all of the software that will exist in the system. Your solution will be segmented into three parts: RAM, EEPROM, and ROM. Specific software requirements include the following:

Other than a one-time initialization, there will be no foreground (main) program

Use the ADC continuous scan mode to simplify the software

Clearly show where the 9S12 is to begin execution on a power on reset

d1) Show the software that goes in the RAM (uninitialized on power up).

d2) Show the software that goes in the EEPROM (nonvolatile, but can be different for each device).

d3) Show the initialization (ritual) software that goes in the ROM (nonvolatile, and must be the same for each device). This is where your system starts executing. Assume the two interrupt vectors are set by the compiler.

d4) Show the 1 kHz DAS interrupt handler that goes in the ROM (nonvolatile, and must be the same for each device). It is here that you will turn on the alarm if the sound energy goes above threshold.

d5) Show the keypad periodic polling interrupt handler that goes in the ROM (nonvolatile, and must be the same for each device). It is here that you will turn off the alarm if the operator types in the secret code.

Request for Solution File

Ask an Expert for Answer!!
Mechanical Engineering: Show the software that goes in the ram uninitialized on
Reference No:- TGS01468056

Expected delivery within 24 Hours