Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Solutions for Final Exam - First-Year Interest Group Seminar | N 1, Exams of Health sciences

Material Type: Exam; Class: FIRST-YEAR INTEREST GROUP SMNR; Subject: Nursing; University: University of Texas - Austin; Term: Spring 2000;

Typology: Exams

Pre 2010

Uploaded on 08/26/2009

koofers-user-dwf-1
koofers-user-dwf-1 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

Related documents


Partial preview of the text

Download Solutions for Final Exam - First-Year Interest Group Seminar | N 1 and more Exams Health sciences in PDF only on Docsity! EE345M Final Exam Solution Spring 2000 Page 1 of 3 Jonathan W. Valvano Jonathan W. Valvano May 16, 2000, 9 am to 12 noon (10) Question 1. The first error component is due to the finite DAC resolution. The DAC resolution is the range (5V) divided by the precision (2n), ∆ = 5/2n. Therefore the maximum error (in V) at that time is ∆ /2 or 5/2n+1. The other error arises from the DAC output rate. If the desired signal has a slope of m, it will change by m/fs during the interval between periodic interrupts. The worse case occurs when 5/2n+1 and m/fs have the same sign, therefore emax = 5/2 n+1 + m/fs (30) Question 2. Design a pulse width measurement system with a range of 10ms to 50s and a resolution of 10ms. You may use any of the PORTT input capture, output compare features, but you MUST USE interrupt synchronization. Assume the digital signal is connected to PT0. You need not worry about pulse width too small, but you need to check for overflow, i.e., if the pulse-width is longer than 50s, then an error condition must be set. (10) Part a) Design the user-level device driver prototypes. You will need to define initialization, and measurement functions. In particular, give the *.H header file, including documentation. This file contains the public functions and public data structures. This section will be graded on style. #define TOOBIG -1 #define WAIT 0 #define BUSY 1 #define DONE 2 void PulseMeasInit(void); // initialize, start measurements short PulseMeasStatus(void){; // 0 waiting for rise, +1 busy counting, +2 done, -1 toobig unsigned short PulseMeasResult(void); // return last measurement, 1 to 50000 ms, restart next /* example usage void main(void){ unsigned short data; PulseMeasInit(): // start measurements while(1){ // infinite loop if(PulseMeasStatus()==TOOBIG){ OutString("error\n); PulseMeasInit(): // restart measurements } if(PulseMeasStatus()==DONE){ data=PulseMeasResult(): // get and continue measurements OutString("PW = "); OutUDec(data); OutString(" ms\n); } // other stuff } */ (20) Part b) This software contains the implementation and is protected from the user. short theStatus; // 0 waiting for rise, +1 busy counting, +2 done, -1 toobig unsigned short cnt; // number of 10ms intervals in this pulse unsigned short PW; // measured pulse width in 10 ms units #define resolution 10000 #pragma interrupt_handler TC1handler() void TC1handler(void){ TFLG1= 0x02; // Acknowledge TC1=TC1+resolution; // every 10 ms if(thestatus==BUSY){ // currently measuring Cnt++; if(Cnt>50000U){ PW=50000U; theStatus=TOOBIG; } } } #pragma interrupt_handler TC0handler() void TC0handler(void){ TFLG1=0x01; // ack, clear C0F if(PORTT&0x01){ // rising interrupt if(thestatus==WAIT){ // currently waiting thestatus=BUSY; // now start counting Cnt=0; } } else{ // falling edge interrupt EE345M Final Exam Solution Spring 2000 Page 2 of 3 Jonathan W. Valvano if(thestatus==BUSY){ // currently counting thestatus=DONE; // now finished PW=Cnt; } } } void PulseMeasInit(void){ // initialize, start measurements asm(" sei"); // make atomic TIOS| = 0x01; // enable OC1 TSCR = 0x80; // enable TMSK2 = 0x33; // 1 us clock TFLG1 = 0x03; // Clear C1F,C0F TMSK1 = 0x03; // Arm OC1 and IC0 TCTL4 |= 0x03; // both edges */ TC1=TCNT+resolution; thestatus=WAIT; // first look for rising edge asm(" cli"); } short PulseMeasStatus(void){ // 0 waiting for rise, +1 busy counting, +2 done, -1 toobig return theStatus; } unsigned short PulseMeasResult(void){ // 1 to 50000 ms thestatus=WAIT; // first look for rising edge return PW; } (40) Question 3. In this problem, you will design a 6812-based ohmmeter. (5) Part a) The measurement resolution is 1000/256 = 3.9 Ω . (5) Part b) A sampling rate of 2 Hz satisfies the Nyquist Theorem. I choose 2 Hz to improve the LPF approach to removing 60 Hz noise. (5) Part c) Since 60 Hz does not exist in the frequencies of interest, the best way in this system to eliminate 60 Hz noise pickup is to use an analog LPF. A 10 Hz LPF will pass 0 to 1 Hz, but reject 60 Hz and its harmonics. (15) Part c) The first Op Amp creates the 1 mA constant current across R. The instrumentation amp provides a high input impedence gain=5 amplifier, and the LPF at 10 Hz prevents aliasing and removes 60 Hz. 1) select the cutoff frequency, fc = 10 Hz 2) divide the two capacitors by 2πfc C1A = 141.4µF/2πfc = 141.4µF/(2π10) = 2.25 µF C2A = 70.7µF/2πfc = 70.7µF/(2π10) = 1.125 µF 3) resistance scale to get R= 200 kΩ . let x =20 R = 10 kΩ •x C1B = C1A/x = 2.25/20 µF = 0.112 µF C2B = C2A/x = 1.125/20 µF = 0.056 µF V1 V2 R Vin 1 R I= V /R = 5V/5kΩ= 1 mAin 1 +5V 5kΩ TLC2274 TLC2274 TLC2274 200 kΩ 200 kΩ 25kΩ10kΩ 25kΩ10kΩ 5kΩ 5kΩ 10kΩ 0.112 µF 0.056 µF 25kΩ 10kΩ5 = 2 • 5kΩ 10kΩ[ ]1 +
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved