






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: Des Microproc Syst; Subject: Electrical Engineering And Computer Science; University: University of Michigan - Ann Arbor; Term: Unknown 2002;
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Rules: Open book. Write and sign the honor code on your blue book.
Do not begin until you are told to do so. You have 75 minutes; budget your time. The questions are not of equal weight; do not spend too much time on a question that is not worth many points. Read through all of the questions before starting to work. This exam is open book and notes, but you may not share reference materials with other students. Please print your name and uniqname
Name: ___________________________
Uniqname: ___________________________
Signature: _________________________________
I. (20 points) Short questions on RAM. Your answers should be brief. I have a 256M bit memory chip. It is organized as 64M x 4 bits.
done: blr
foo:
boo:
(10 points) Write the coo function using the PowerPC ABI convention we used in the lab
coo:
(5 points) What happens if main is executed as is?
III. (15 points total) A/D converters.
(5 points) Consider a four-bit analog-to-digital converter with an input range of 0-10V. After a conversion, the ADC returns a value of 9. Assuming an ideal converter, what is the possible voltage range of the analog signal?
(5 points) If your program assumes that the analog input is in the center of this range, what is the range of possible error in volts?
(5 points) If this is a flash-type ADC, how many voltage comparators does it contain?
IV. (40 points total) ISR Question
This question involves a system built upon the MPC823 you are familiar with from lab. Proceed accordingly. The part of the system you are to design involves the maintenance and monitoring of the water temperature of an aquarium. You will write an ISR to implement your solution. This question relies heavily on your lab section experience.
You must keep the temperature within the range of 60 to 70 degrees Fahrenheit. To facilitate this you are given a Temperature Control System (TCS) involving a heater and cooler separately controlled. The TCS will register three interrupts on IRQ1 of the MPC823. One to indicate passing the lower limit of the valid temperature range, one to indicate passing the upper limit, and one to indicate reaching 65 degrees (the middle of the range). The details of the TCS are hidden from you behind the following function calls:
void TCS_ctl_cooler ( bool on ) // Takes a boolean (0 = false, else = true) argument to set state of cooler. If same as current state, no change
v oid TCS_ctl_heater ( bool on ) // Takes a boolean (0 = false, else = true) argument to set state of heater. If same as current state, no change
void TCS_clearints // Clears ALL interrupts currently asserted by the hardware of the TCS // Due to semantics of this problem, you should never have more than // one int from the TCS at a time.
int tc_gettemp // Returns the temperature of the temperature control system
Note: You must use these, and only these, function calls to access the TCS.
Upon receiving a TCS interrupt you must determine the proper action to maintain the temperature range. For example, if you pass the lower limit, turn on the heater, and return from the interrupt. Soon, you will get an interrupt indicating 65 degrees, and you will need to turn the heater off (Hint: You have no way of knowing whether you were heating or cooling, but it should not matter. See function descriptions).
Note: You do not need to worry about fluctuations around the limit temperatures. That is, assume that you will get the interrupt upon passing a border and by time you return from that interrupt the temperature will have already risen or fallen back into the valid range.
Secondly, the RTC will have been initialized to interrupt every second on Level 0. Upon each interrupt, you will need to get the current temperature from the TCS, and display it.
mfspr r3, IMMR andis r3, r3, 0xFFFF lis r4, 0x stw r4, SIPEND(r3) #Clear INT lwz r4, SIMASK(r3) lis r5, 0xDFFF andi r5, r5, 0xFFFF and r4, r4, r stw r4, SIMASK(r3) #disable IRQ blr
Part B(10 points) Rewrite the ISR to use auto-vectored interrupts (SIVEC).
Note: Not commenting will result in a severe loss of points.