PROCEDURE - 3 | EXPERIMENT NO. 5 TITLE: Interrupt Handling and Timer Interfacing (8085/8086 Microprocessors with 8253/8254 Timer) | Microcontroller Lab
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Interactive Audio Lesson

Listen to a student-teacher conversation explaining the topic in a relatable way.

Introduction to Interrupt Handling

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Today, we're going to explore the concept of interrupt handling in microprocessors. Can anyone tell me why interrupts are important?

Student 1
Student 1

Interrupts help the microprocessor manage events without constantly checking each device.

Teacher
Teacher

Exactly! Interrupts allow for efficient event-driven processing. Can anyone name the two types of interrupts?

Student 2
Student 2

Hardware interrupts and software interrupts!

Teacher
Teacher

Correct! Remember the acronym HSI—Hardware, Software, Interrupts. Let's also consider context saving; why is it necessary during an interrupt?

Student 3
Student 3

It’s needed to preserve the state of the program that was interrupted.

Teacher
Teacher

Right! This preservation allows the program to resume seamlessly. Let’s summarize: Interrupts enable efficient interaction with external events—HSI is the key acronym here.

Examining the Procedure for Interrupt Handling

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Now that we understand interrupts, let’s go through the setup. Who can describe the first step for Part A of the experiment?

Student 4
Student 4

We need to identify the RST 7.5 input pin on the 8085 trainer kit.

Teacher
Teacher

Correct! Then we connect an LED to the output pin of the 8255 PPI, which will help us visualize our interrupt actions. What do we do next?

Student 1
Student 1

We enter the main program starting from a memory location, like 2000H, and configure 8255 for output.

Teacher
Teacher

Perfect! The outline for this procedure is very structured. A good memory aid is ‘Setup, Program, Observe—SPO.’ Let's reflect on how we execute the ISR and its role.

Timer Interfacing with 8254

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Let's shift gears to Part B: Timer interfacing with the 8254. What is the first setup step here?

Student 2
Student 2

Identifying the 8254 PPI on the trainer kit and locating its CLK, GATE, and OUT pins.

Teacher
Teacher

Absolutely! Then what should we connect the OUT pin to for observation?

Student 3
Student 3

We connect it to an LED for delay observation or to an oscilloscope to view the square wave.

Teacher
Teacher

Excellently put! After that, we must calculate the initial count for our timer based on the desired delay. Who remembers the formula for that?

Student 4
Student 4

Initial Count = Delay * Clock Frequency!

Teacher
Teacher

Great! It's crucial to manage expected delays vs. clock frequency to ensure accuracy. Let’s summarize this with ‘SETUP Linkage, Count Control—SLCC.’

Executing and Observing Timer Functions

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

We’ve configured the 8254; now let’s review the execution process. If we run our delay program, what should we observe?

Student 1
Student 1

The LED should change state after the set delay!

Teacher
Teacher

Exactly! And for square wave generation, how do we ensure continuous output?

Student 2
Student 2

Keep the GATE pin high for counting.

Teacher
Teacher

Spot on! Remember to document what you observe post-execution. Use CAH—Count, Analyze, and Highlight as your memory aid for this step.

Introduction & Overview

Read a summary of the section's main ideas. Choose from Basic, Medium, or Detailed.

Quick Overview

This section outlines the procedure for conducting Experiment No. 5, which includes understanding interrupt handling in 8085/8086 microprocessors and interfacing the 8254 timer.

Standard

The section details the step-by-step procedure for performing the experiment, which is divided into two parts: Interrupt Handling using the 8085 microprocessor and Timer Interfacing using the 8254 timer. It includes system setups, program entries, execution, and observations necessary for proper execution.

Detailed

Detailed Summary of Procedure

Overview

This section describes the detailed procedure to execute Experiment No. 5, focusing on Interrupt Handling and Timer Interfacing using 8085/8086 microprocessors and the 8253/8254 Programmable Interval Timer.

Experiment Structure

The experiment is structured into two main parts:
1. Part A: Interrupt Handling (8085) - This involves setting up an 8085 microprocessor to handle interrupts and observe their operation by toggling an LED connected through a Programmable Peripheral Interface (8255).
2. Part B: Timer Interfacing (8254) - This section covers configuring the 8254 timer to generate specific time delays and square waves and observing the output.

Each part involves systematic procedures: setting up the system, programming necessary instructions, and executing the program while observing the output to validate the functionality. This hands-on approach enhances the understanding of hardware interrupts, subroutine calling in ISRs, and timer functionalities.

Audio Book

Dive deep into the subject with an immersive audiobook experience.

Part A: Interrupt Handling (8085)

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

  1. System Setup:
  2. Identify the RST 7.5 input pin or dedicated push button on your 8085 trainer kit.
  3. Connect an LED (with a suitable current limiting resistor) to one of the output pins of an integrated 8255 PPI (e.g., Port A, bit 0). Ensure the 8255 is configured for output initially.
  4. Program Entry:
  5. Enter the main program (including 8255 initialization and interrupt enable) starting from a suitable memory location (e.g., 2000H).
  6. Enter the Interrupt Service Routine (ISR) for RST 7.5 starting at its vector address, which is 003CH. If your kit's monitor prevents writing directly to 003CH, you may need to write the ISR elsewhere and put a JMP instruction at 003CH pointing to your ISR. However, ideally, the ISR is written directly at 003CH.
  7. Execution and Observation:
  8. Run the main program (GO 2000).
  9. The LED connected to the 8255 output port should initially be in a specific state (e.g., OFF).
  10. Press the RST 7.5 push button or apply a positive edge signal to the RST 7.5 pin.
  11. Observe the LED toggling its state (e.g., from OFF to ON). Each subsequent press should toggle the LED again.
  12. Observe the Program Counter and register contents (if your kit allows real-time observation or single-stepping through ISR).

Detailed Explanation

In this part, we set up the necessary environment to handle hardware interrupts using the 8085 microprocessor. The system setup involves identifying the RST 7.5 pin used for interrupts and connecting an LED for visual feedback. The program entry involves writing a main program that initializes the system and specifies the ISR for handling the interrupt. When an interrupt occurs (such as pressing the RST 7.5 button), we expect the LED to toggle its state, demonstrating the interrupt functionality. The observations made during execution help confirm that the system reacts correctly to the interrupt signal.

Examples & Analogies

Imagine you're a waiter in a restaurant (the microprocessor) who is busy serving food (running the main program). If a customer presses the bell on the table (the interrupt), you stop what you're doing, take care of that customer's need (execute the ISR), and once that's done, you go back to serving food where you left off. Connecting an LED is like putting up a sign for the customers to see whenever you serve them, enhancing their dining experience.

Part B: Timer Interfacing (8254)

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

  1. System Setup:
  2. Identify the 8254 PPI on your trainer kit. Locate its CLK, GATE, and OUT pins for one of the counters (e.g., Counter 0).
  3. Connect the OUT0 pin to an LED (for delay observation) or directly to an oscilloscope (for square wave observation).
  4. Ensure an appropriate clock source is provided to CLK0 (many kits provide an internal clock, or you may need to connect an external crystal/oscillator output). For square wave generation, a stable clock input is essential.
  5. Program Entry:
  6. Calculate the required initial count based on the desired delay or frequency (refer to "Calculation of Initial Count" in the Theory section).
  7. Enter the assembly programs for Mode 0 and Mode 3 starting from a suitable memory location (e.g., 2000H for each).
  8. Execution and Observation (Mode 0 - Delay):
  9. Run the Mode 0 program (GO 2000).
  10. Observe the LED: It should remain in its initial state for the programmed delay duration and then change state once (e.g., from OFF to ON) indicating the terminal count was reached. This is a one-shot delay.
  11. Execution and Observation (Mode 3 - Square Wave):
  12. Run the Mode 3 program (GO 2000).
  13. Connect the OUT0 pin to an oscilloscope.
  14. Observe the generated waveform on the oscilloscope. Verify its frequency and duty cycle against your calculations.

Detailed Explanation

In Part B, we are interfacing the 8254 timer to generate specific time delays and square wave outputs. We first set up the timer by connecting its control pins to visualize output. The configuration is crucial; we need to determine the correct initial count based on our timing requirements. There are two modes of operation demonstrated here: Mode 0 for generating a single time delay and Mode 3 for creating a continuous square wave. By closely observing the LED or using an oscilloscope, we can confirm the timer's performance and accuracy based on our calculations.

Examples & Analogies

Think of a bakery with a timer (the 8254) that signals when cookies need to come out of the oven. When the timer is set (configured), it starts counting down (entering the initial count). Once the time is up (the delay), the timer rings (the LED turns ON), indicating that the cookies should be checked. In another scenario, if the bakery wants to keep the kitchen busy, the timer can be set to repeatedly ding every few minutes (square wave mode), reminding bakers to check on items consistently, ensuring they never miss a batch.

Definitions & Key Concepts

Learn essential terms and foundational ideas that form the basis of the topic.

Key Concepts

  • Interrupts allow the microprocessor to react to external events efficiently.

  • The ISR temporarily replaces the main program execution to handle the interrupt.

  • 8255 PPI facilitates peripheral connections with the microprocessor.

  • The 8254 timer is essential for generating precise delays and timing signals.

Examples & Real-Life Applications

See how the concepts apply in real-world scenarios to understand their practical implications.

Examples

  • When pressing a key on a keyboard, a hardware interrupt signals the CPU to read the key input.

  • Using the 8254 timer to generate a square wave can be seen in clock generation for synchronous circuits.

Memory Aids

Use mnemonics, acronyms, or visual cues to help remember key information more easily.

🎵 Rhymes Time

  • Interrupts come to play, events can't delay; they signal the CPU, so work's on the way.

📖 Fascinating Stories

  • Imagine a mailman (ISR) who runs to deliver urgent mail (interrupt) while the office (main program) continues working. The mailman returns after delivering, resuming their tasks.

🧠 Other Memory Gems

  • Remember HSI for types of interrupts: Hardware, Software, Interrupts.

🎯 Super Acronyms

Use SLCC

  • **S**ETUP
  • **L**inkage
  • **C**ount **C**ontrol for timer interfacing steps.

Flash Cards

Review key concepts with flashcards.

Glossary of Terms

Review the Definitions for terms.

  • Term: Interrupt

    Definition:

    A signal to the microprocessor from a peripheral device or software indicating an event requiring immediate attention.

  • Term: ISR

    Definition:

    Interrupt Service Routine; a special routine that the microprocessor executes in response to an interrupt.

  • Term: 8255 PPI

    Definition:

    Programmable Peripheral Interface; allows for connecting the microprocessor to a variety of peripherals.

  • Term: 8254 Timer

    Definition:

    A Programmable Interval Timer used to generate specific time delays and square waves.

  • Term: SIM Instruction

    Definition:

    Set Interrupt Mask; used in 8085 to control maskable interrupts.