HW4soln-3750

HW4soln-3750 - 1 EE 3750 HW 4 solutions EE 3750 Homework 4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE 3750 — HW 4 solutions 1 EE 3750 — Homework 4 solutions Fall 2001 1. Write an 8086 instruction sequence to control a simple car radio tuner. Use program- controlled I/O. The tuner is to receive inputs from two buttons to change to preset station frequencies, an up/down signal to increment/decrement the frequency, and a reset button to change one of the station presets. The tuner is to output the new frequency whenever a change has occurred. For simplicity, assume that radio station frequencies are 16-bit integers. There are three input ports (preset, up/down, and reset) and one output port (freq). Each input from a data or status port is to be a single byte; the output to a data port is to be a word. Assume that three word variables have been initialized: PREFREQ1, PREFREQ2, and CURRFREQ, holding the preset frequency for station 1, the preset frequency for station 2, and the current radio frequency. Your program is to poll the preset buttons port to determine when to change the frequency to a preset station. The data port will hold 1 (2) when preset button 1 (button 2) has been pressed and the tuner is to change the frequency to preset frequency 1 (preset frequency 2). Your program is to poll the up/down button port to determine whether to increment (1) or decrement (2) the frequency (that is, the data port will hold 1 for increment and 2 for decrement). Your program is to poll the reset button port to determine whether to reset a station preset frequency (1) or not (0). If so, then when the next preset button is pressed, change that preset frequency to the current radio frequency. When a frequency changes, the tuner is to write the new frequency to the output frequency port. You may assume that this port is always ready. Bit 2 is the ready bit in each status register. Describe the priority structure you have assigned to the various ports. Your program is to always be ready to handle any button pushed by the user. Explicitly state any other assumptions that you make in writing this program. The table below gives status and data port addresses. device status port data port preset 21H 20H up/down 31H 30H reset 41H 40H freq 50H Assume that byte variable RESETFLAG has been defined and initialized to 0. This is a flag with value 1 indicating that the reset button has been pushed and when the next preset button is pressed, it should change the preset frequency; value 0 indicates otherwise. This solution places the three inputs at equal priority.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.

Page1 / 5

HW4soln-3750 - 1 EE 3750 HW 4 solutions EE 3750 Homework 4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online