Docsity

Digital Output - Introductory Microcomputer Interfacing Laboratory - Solved Exam, Exams of Microcomputers

Toggle sidebar
bg1
February 26, 1997 page 1 S. Derenzo
Solutions for Midterm #1 - EECS 145M Spring 1998
1a
Temperature sensor
12
"take data"
"data available"
Digital
output
port
Digital
input
port
Micro-
computer
temperature
1b
1The program outputs a one to the digital output port, which makes ā€œtake dataā€ high
2The program starts a loop that continuously reads the 16 bits of data and exits when the
ā€œoutput data availableā€ line goes high.
3The temperature sensor detects a one on ā€œtake dataā€, senses the temperature, converts to into a
12-bit number
4The temperature sensor asserts the 12-bit number on the 12 output lines
5The temperature sensor makes the ā€œoutput data availableā€ line high
6The program detects the ā€œoutput data availableā€ signal, and exits the loop
7The program masks the 12-bit number from the 16 bit data
8The program makes ā€œtake dataā€ low
9The sensor makes ā€œoutput data availableā€ low
[4 points off if the computer never reads ā€œoutput data availableā€]
[2 points off if computer makes ā€œtake dataā€ low before reading data]
1c Take data
Data valid No NoYes
Data available
Temperature sensed
and converted
Computer reads data
pf3

Partial preview of the text

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

Solutions for Midterm #1 - EECS 145M Spring 1998

1a

Temperature sensor

12

"take data"

"data available"

Digital output port

Digital input port

Micro- computer

temperature

1b 1 The program outputs a one to the digital output port, which makes ā€œtake dataā€ high 2 The program starts a loop that continuously reads the 16 bits of data and exits when the ā€œoutput data availableā€ line goes high. 3 The temperature sensor detects a one on ā€œtake dataā€, senses the temperature, converts to into a 12-bit number 4 The temperature sensor asserts the 12-bit number on the 12 output lines 5 The temperature sensor makes the ā€œoutput data availableā€ line high 6 The program detects the ā€œoutput data availableā€ signal, and exits the loop 7 The program masks the 12-bit number from the 16 bit data 8 The program makes ā€œtake dataā€ low 9 The sensor makes ā€œoutput data availableā€ low

[4 points off if the computer never reads ā€œoutput data availableā€] [2 points off if computer makes ā€œtake dataā€ low before reading data]

1c Take data

Data valid (^) No Yes No

Data available

Temperature sensed and converted

Computer reads data

2a

Temperature sensor 1

"take data"

"data available 1"

Digital output port

Digital input port

Micro- computer

temperature

Temperature sensor 2

temperature

Two octal tri-state buffers

12

"output enable 1"

Two octal tri-state buffers

12

"data available 2"

data bus "take data" (^) "output enable 2"

2b

1 The program outputs a word to the digital output port that has a one on the ā€œtake dataā€ bit, and ones on both output enable 1 and 2 to ignore the sensors. 2 The two temperature sensors simultaneously start producing a digital output 3 The program reads the digital input port in a loop waiting for ā€œoutput data available nā€, n = 1 or 2 to go high (Note that these two signals do not need tri-state buffers and can be read directly to constantly monitor both temperature sensors) 4 If sensor n (n = 1 or 2) is ready first, it makes ā€œoutput data available nā€ high 5 The program detects the "output data available n" signal and writes a word to the digital output port with one on the ā€œtake dataā€ bit, a zero on the ā€œoutput enable nā€ bit to select sensor n, and a one on the ā€œoutput enable 3-nā€ bit to ignore sensor 3-n. (Note: If n = 1, 3-n = 2. If n = 2, 3-n = 1.) 6 The program reads the input port for the sensor n data 7 The program masks the data to produce the 12-bit value from temperature sensor n 8 The program continues to read the digital input port in a loop waiting for the ā€œoutput data available 3-nā€ bit to go high 9 When sensor 3-n is ready, it brings ā€œoutput data available 3-nā€ high 10 The program detects the ā€œoutput data available 3-nā€ and writes a word to the digital output port that has a one on the ā€œtake dataā€ bit, a one on the ā€œoutput enable nā€ bit to ignore sensor n, and a zero on the ā€œoutput enable 3-nā€ bit to select sensor 3-n. 11 The program reads the input port for the sensor n data 12 The program masks the data to produce the 12-bit value from temperature sensor n 13 The program writes a word to the digital output port that brings ā€œtake dataā€ low [4 points off if the computer does not read the ā€œoutput data availableā€ signals [4 points off if the computer does not selectively enable the two tri-states before reading data]