0% found this document useful (0 votes)
10 views

MicroLab-Exp2

Uploaded by

Roukoz l
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

MicroLab-Exp2

Uploaded by

Roukoz l
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

An-Najah National University ‫جامعة النجاح الوطنية‬

‫كلية الهندسة و تكنولوجيا المعلومات‬


Faculty of Engineering and IT

Computer Engineering Department


Course Name: Microprocessor Lab Number: 10636392
Lab Report Grading Sheet

Instructor: Dr. Deema-Sawalha Experiment #: 2


Academic Year: 2024 Experiment Name: 8253 timer / counter
Semester: First-Semester

Students
1. Manar Nofal 2. Marah Sirhed
3. Rama Yaseen 4.
Performed on: 21/11/2024 Submitted on: 28/11/2024

Report’s Outcomes
ILO =( ) % ILO =( ) % ILO =( ) % ILO =( ) % ILO =( ) %
Evaluation Criterion Grade Points
Abstract
answers of the questions: “What did you do? How did you do it? 0.5
What did you find?”
Introduction and Theory
Sufficient, clear and complete statement of objectives. In addition to 1.5
Presents sufficiently the theoretical basis.
Apparatus/ Procedure
Apparatus sufficiently described to enable another experimenter to
2
identify the equipment needed to conduct the experiment.
Procedure sufficiently described.
Experimental Results and Discussion (In-Lab Worksheet)
Crisp explanation of experimental results. Comparison of theoretical
4
predictions to experimental results, including discussion of accuracy
and error analysis in some cases.
Conclusions and Recommendations
Conclusions summarize the major findings from the experimental
1
results with adequate specificity. Recommendations appropriate in
light of conclusions. Correct grammar.
Appearance
Title page is complete, page numbers applied, content is well 1
organized, correct spelling, fonts are consistent, good visual appeal.

Total 10

1
An-Najah National University ‫جامعة النجاح الوطنية‬
‫كلية الهندسة و تكنولوجيا المعلومات‬
Faculty of Engineering and IT

Abstract:
In this experiment, we will learn to understand the operating modes and programming
principles of the 8253 timer by implementing two counters: one in square wave mode and
the other as a rate generator.

Introduction and Theory:


The 8253 is a programmable timer/counter featuring three 16-bit counters, operating
within a frequency range of 0 to 2 MHz, powered by a single +5V supply. We begin by
identifying the 8253 and studying its internal structure, followed by resetting the kit,
selecting a suitable communication rate (9600 baud), configuring the system, and writing
code for counter 0.

Apparatuses:
- MML8086K3: 8253 counter/timing
- keypad.
- MML8086K3 Software: dice8088.
- Oscilloscope.

The Procedure or we say the task description:


In this experiment, we are tasked with writing assembly code to program the 8253 IC twice:
once to configure counter 0 to generate square waves, and another time to produce a rate
generator output. Before explaining the procedure, it's important to provide a brief overview
of the 8253 IC. It contains three counters, labeled counter 0 through counter 2, each of which
is 16 bits. The counters are programmed by writing a control word.

The shape for 8253-IC:

2
An-Najah National University ‫جامعة النجاح الوطنية‬
‫كلية الهندسة و تكنولوجيا المعلومات‬
Faculty of Engineering and IT

Now we want to describe the procedure for our experiment which they are:

 Starting the MML8086K3 Trainer:


1. Connect the MML8086K3 Trainer to the PC through USB or RS232 serial
communication cables.
2. Turn on the experimental system outside the AC power switch, and then hit the “ON”
position of the DC power switch +5 V, +12 V, -12V (B3 area JP3). The LED indicator light
should be turned on and the experimental instrument should show flashing P
indicating that the initialization is successful, and the system is in a standby state.
3. On the PC, start the MML8086K3 software (dice8088).
 setup the serial communication on software by clicking on the "Device" menu under
the "Settings" tab.
 Before we run our assembly code on MML8086K3 trainer, we had to do the
following: -
1. Power on the MML8086K3 trainer (as described earlier) and make sure that it is in the
standby state which is indicated by P on the 7-segment display circuit module. You can
reset the trainer system by pressing the RESET (RST) button.
2. Open your ASM code file and click the "compile load" command under the "Debug"
menu. if there are no compilation errors, the program should be loaded to the trainer
system.
3. On the MML8086K3 trainer kit, press the EX/FV button to execute the loaded
program.
 Before we display and discuss the code, we must make sure that that the counter is
programmed by writing a Control Word so at first, we write it and choose which
counter we need and mode according to the control word format as below:

Part 1:

- We set counter 0 to mode 3 (square wave) with a frequency of 10kH and assumed the
input frequency was 1MHz, so we used the table in Figure 1 to assist us construct the
control word and send it to the control word register

3
An-Najah National University ‫جامعة النجاح الوطنية‬
‫كلية الهندسة و تكنولوجيا المعلومات‬
Faculty of Engineering and IT

- We want to use counter 0, also we want to read/load least significant byte only, then
choose mode 3, and we want a binary counter 16-bit so the control word will be
(00010110b).

- Also, we must compute the value that will be sent to counter "0" by dividing the input
frequency by the output frequency ((1MH/10KH) =100).

- Because the number is even, we must assume that the wave is high for one half
(100/2) and low for the other half (100/2).

Finally, our assembly code for the first part was:

The output got like:

4
An-Najah National University ‫جامعة النجاح الوطنية‬
‫كلية الهندسة و تكنولوجيا المعلومات‬
Faculty of Engineering and IT

Part 2:
- In this part, we set counter 0 to mode 2 (rate generator) with a period of 100ms and a
1MHz input frequency.
- We set counter 0 and read/loaded the least significant byte, then switched to mode 2
and set a 16-bit binary counter so the control word would be (00010100b).

The code for the second part:

The output got like

5
An-Najah National University ‫جامعة النجاح الوطنية‬
‫كلية الهندسة و تكنولوجيا المعلومات‬
Faculty of Engineering and IT

Discussion and conclusion:


In this experiment, we gained an understanding of how to work with the 8253 IC and program
it is using the control word register. We explored various modes to generate different
waveforms and learned how to adjust the frequency by either increasing or decreasing it,
allowing us to modify the input frequency value.

You might also like