Distance - Introductory Microcomputer Interfacing Laboratory - Solved Exam, Exams of Microcomputers

Main points of this past exam are: Distance, Pulsed Laser, Narrow, Digital Input Line, Duration, Original Direction, Digital Pulse

Typology: Exams

2012/2013

Uploaded on 03/22/2013

saryu
saryu 🇮🇳

4.3

(4)

42 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Solutions for Midterm - EECS 145M Spring 1997
1a
Moon
µComputer*
Counter/
Timer*
Parallel
output
port*
Parallel
input
port*
Mirror
Photodetector*
Laser*
Trigger*
Detect
light*
Laser beam*
[showing moon or mirror was good but not required for full credit- they are strictly speaking not a
part of your system]
[1.5 points off for each starred (*) element missing; 0.5 points off for each starred element without
a label] [0.5 points off if one of the laser beam legs is missing]
Note: “Connection” is not limited to wires- consider radio and fiber-optic communications.
1b
long i1, i2,;
double time, dist;
outport(1,0); /* zero counter */
outport(2,0); /* make trigger low */
outport(2,1); /* make trigger high to fire laser */
while(inport(3,1) == 1); /* make sure detection signal starts low
(ignore any prompt laser light) */
while(inport(3,1) == 0); /* wait for reflected laser beam */
outportb(1,1); /* latch timer*/
i1 = inport(1); /* read least significant word */
i2 = inport(1); /* most least significant word */
time = i2 << 16 | i1; /* pack time value in µs */
dist = time * 0.15; /* convert to km */
For full credit, it was essential to do the following:
1Assert the trigger output first low, then high
2Wait for the reflected laser light to go high (ignoring any prompt light is good design but not
required for full credit)
3Latch the timer before reading
4Convert time to distance in km
[2 points off if the outport(2,0); command is missing]
February 26, 1997 page 1 S. Derenzo
pf3

Partial preview of the text

Download Distance - Introductory Microcomputer Interfacing Laboratory - Solved Exam and more Exams Microcomputers in PDF only on Docsity!

Solutions for Midterm - EECS 145M Spring 1997

1a

Moon

μComputer*

Counter/ Timer*

Parallel output port*

Parallel input port*

Mirror

Photodetector*

Laser*

Trigger*

Detect light*

Laser beam*

[showing moon or mirror was good but not required for full credit- they are strictly speaking not a part of your system] [1.5 points off for each starred (*) element missing; 0.5 points off for each starred element without a label] [0.5 points off if one of the laser beam legs is missing] Note: “Connection” is not limited to wires- consider radio and fiber-optic communications.

1b

l ong i1, i2,; double time, dist; outport(1,0); /* zero counter / outport(2,0); / make trigger low / outport(2,1); / make trigger high to fire laser / while(inport(3,1) == 1); / make sure detection signal starts low (ignore any prompt laser light) / while(inport(3,1) == 0); / wait for reflected laser beam / outportb(1,1); / latch timer/ i1 = inport(1); / read least significant word / i2 = inport(1); / most least significant word / time = i2 << 16 | i1; / pack time value in μs / dist = time * 0.15; / convert to km */

For full credit, it was essential to do the following: 1 Assert the trigger output first low, then high 2 Wait for the reflected laser light to go high (ignoring any prompt light is good design but not required for full credit) 3 Latch the timer before reading 4 Convert time to distance in km [2 points off if the outport(2,0); command is missing]

1c

Trigger

Laser light

Photodetector

10 μs

10 μs 2 s

Clock Counter (^0 1 2 3 4 5 )

[1 point off if no trigger pulse] [2 points off if no time scale or time information]

1d d = vt /

σ d 2 =

dt

2 σ t 2

dv

2 σ v 2 =

v 2

2 σ t 2

t 2

2 σ v 2 =

vt 2

t

2 σ t 2

vt 2

v

2 σ v 2

σ d d

2

σ t t

2

σ v v

2

d = 300,000 km t = 2 s σ t = 1 μs v = 300,000 km/s σ v = 0.15 km/s

σ d d

2

10 −^6

2

2 = 2

10 −^6

2

σ d = d 2

10 −^6

 =^

0.3km 2

= 0.212km

[12 points off for σd = σt σv = 1.5 x 10–7^ km] [2 points off for v = dt] [2 points off for the alternative, less statistically accurate method ∆d = (t + ∆t) (v + ∆v)/2 - tv/2 = 0.3 km]

2a

μComputer

16-bit output port

"output data available"

16

D/A (^) External circuit

"capture data"

Analog Digital data voltage

[1.5 points off for each element shown above that is missing; 0.5 points off for each without a label]