💡

Interfacing Seven Segment Display Tutorial

Aug 29, 2024

Interfacing of Seven Segment Display

Introduction

  • Today's topic: Interfacing of Seven Segment Display (SSD)
  • Previous video covered interfacing of LEDs
  • SSD is also referred to as seven segment display device

Basic Concepts

  • Two types of LED connections:
    • Common Anode
    • Common Cathode
  • Preferred connection for 8051: Common Anode
    • Reason: Common cathode requires minimum 20mA current, which is not possible for 8051
    • Using common anode allows the anode current to flow into the microcontroller

Seven Segment Display Structure

  • General structure includes:
    • Segments labeled A to G
    • Decimal point (DP)
    • Anode terminal and cathode terminal
  • To display numbers:
    • Example: Displaying 8 means all segments (A-G) should glow, DP off
    • Displaying 1 means only segments B and C should glow
    • Selecting which segments to turn on/off based on desired display

Coding for Seven Segment Display

  • Chart for displaying digits 0 to F in hexadecimal:
    • Common Anode configuration:
      • Logic 0 for segments that glow
      • Logic 1 for segments that do not glow
  • Example for displaying 8: All segments A to G = 0, DP = 1
  • Example for displaying 5: B, E, C segments = 0; others = 1
  • Hexadecimal calculation for segments:
    • Example: Displaying 5 corresponds to binary representation

Interfacing Multiplexed Display

  • Requirement for using 4 SSDs
    • Connecting one SSD to one port requires four ports (P0 to P3)
    • Can create a multiplexed display to reduce the number of ports used
    • Activate one display at a time to simulate all displays working simultaneously

Interfacing Diagram

  • Block diagram includes:
    • PNP transistors connected to four SSDs
    • Current limiting resistors for each segment
    • Requirements for logic levels to activate the desired SSD
  • Logic levels:
    • Activate one transistor by applying logic 0 to its base, others at logic 1
    • Example: Pin P2.0 activated while others are not

Programming

  • Discussed a programming example using embedded C
    • Assume a delay of 10 milliseconds
  • Basic delay calculation:
    • T_in = 1.085 microseconds
    • Calculate N for required delay
  • Example hex counter program:
    • Counting from 0 to 15 in hexadecimal
    • Display logic and delay functions

Interfacing Diagram

  • Interfacing diagram includes:
    • Port connections
    • Display driver (74LS424)
    • Corresponding segments

Conclusion

  • Summarized the interfacing of SSD with 8051 microcontroller
  • Discussed relevant programming details and calculations
  • Reminder to draw the interfacing diagram and write the program
  • Thanked students for watching the session.