100% found this document useful (1 vote)
391 views4 pages

7-Segment Display with 8086 Code

This document provides instructions for a lab experiment to display digits from 0-7 on a 7-segment display. It explains that the 7-segment display can be controlled through ports on the 8086 trainer kit. Binary or hexadecimal values are written to the ports to turn specific segments on and off to display each digit. The document includes example assembly code that displays the number 3 on the 7-segment display. Students are instructed to write a program that will sequentially display all digits from 0-9.

Uploaded by

Faraz Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Topics covered

  • Hardware interfacing,
  • Programming logic,
  • Data representation,
  • Programming environment,
  • LCD message,
  • Programming environment setup,
  • Instruction set,
  • Programming tasks,
  • Control signals,
  • Hardware setup
100% found this document useful (1 vote)
391 views4 pages

7-Segment Display with 8086 Code

This document provides instructions for a lab experiment to display digits from 0-7 on a 7-segment display. It explains that the 7-segment display can be controlled through ports on the 8086 trainer kit. Binary or hexadecimal values are written to the ports to turn specific segments on and off to display each digit. The document includes example assembly code that displays the number 3 on the 7-segment display. Students are instructed to write a program that will sequentially display all digits from 0-9.

Uploaded by

Faraz Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Topics covered

  • Hardware interfacing,
  • Programming logic,
  • Data representation,
  • Programming environment,
  • LCD message,
  • Programming environment setup,
  • Instruction set,
  • Programming tasks,
  • Control signals,
  • Hardware setup

Lab#10: 7-segment display SSUET/QR/114

LAB # 10
Objective:
Write a program to display the digits in decimal, from 0-7 in to 7-segment.

Theory:

7 SEGMENT DISPLAY:
 The 7 segment inside the MDA – 8086 trainer kit can be used to display numbers.
 This requires PIO 8255 ports which are already connected to the 7 segment internally.
 Through the code we can access these ports and provide binary or hex value to switch the
required segment on and off.
 In order to turn a segment ON, a logical 0 is required as shown below.

 Any number from 0 – 9 can be display on the 7 segment by providing the actual hex or
binary value which turns those segments ON to display the digit.

CE-207: Microprocessor and Microcontroller 43


Lab#10: 7-segment display SSUET/QR/114

SOURCE CODE:
Assembly code Equivalent machine language code

Mov Al, 80H ;to make all port out BO 80


use 80h
in command byte
Out 1F, AL ; mov 80h to port C E6 1F
Mov AL,B0H ; mov B0=3 to AL B0 B0
Out 19H, AL ; mov B0=3 to port A E6 19
Int 3 CC

STEPS TO FOLLOW:
1. STEP#1: Put the Kit in PC mode, move jumper P1 which located on the kit like this.

2. STEP#2 :Connect RS232 cable to PC.


3. STEP#3: After moving JP1 to serial monitor status and if on a power-up or pressing
RES key,following message will be displayed on LCD and data communication is
possible with computer.

You are now ready to work in PC mode.


4. STEP#4:Open wincomm and set segment and offset(e-g:E 0000:1000)
5. STEP#5:Write above machine language code in wincomm.
6. STEP#6:Press G for execute.

SCREEN SHOTS:

CE-207: Microprocessor and Microcontroller 44


Lab#10: 7-segment display SSUET/QR/114

OUTPUT: 3” (B0) is displayed on the 7 segment in MDA – 8086

TASK#1:Write a program to display all digits from 0-9 as shown in the following diagram.

CE-207: Microprocessor and Microcontroller 45


Lab#10: 7-segment display SSUET/QR/114

SOLUTION:

CE-207: Microprocessor and Microcontroller 46

Common questions

Powered by AI

The PIO 8255 ports are crucial for the operation of a 7-segment display on the MDA-8086 trainer kit because they interface directly with the display, allowing binary or hex values to be sent to control which segments light up. These ports enable the microprocessor to communicate with the 7-segment display by providing the necessary logical signals (logical 0 for ON and logical 1 for OFF) required to manipulate each segment appropriately. Without this interfacing through the PIO 8255 ports, controlling segment states and thus displaying digits on the 7-segment display would not be possible .

After the MDA-8086 trainer kit is powered up or reset, it displays readiness for data communication by showing a specific message on the LCD. This message confirms that the system has achieved serial monitor status, allowing data to be sent and received successfully between the computer and the microcontroller through the RS232 connection .

A logical 0 is used to turn a segment ON in a 7-segment display system primarily due to the system's electrical design, which may be based on active-low logic. In such a setup, sending a logical 0 signals the electronics controlling each segment to activate that segment, allowing current to flow through the LED or display element. This active-low configuration minimizes power usage and can help simplify the circuit design since it allows using common-ground configurations easily adaptable to microcontroller outputs .

The programming of a 7-segment display on the MDA-8086 trainer kit in an educational lab involves several crucial steps: 1) Setting the jumper P1 to enable PC mode ensures that the kit is ready to receive program instructions from a PC; 2) Connecting the RS232 cable establishes a communication link between the PC and microcontroller; 3) Upon a power-up or reset, a confirming message on the LCD indicates the kit's readiness for interfacing; 4) Using wincomm software, students set the segment and offset, ensuring correct memory addressing; 5) Inputting the machine language code programs the desired digit sequences; 6) Executing the code tests the logic applied in the programming process. Each step not only facilitates successful interfacing and display but teaches critical skills in debugging, understanding hardware constraints, and logical thinking .

The lab task of displaying all digits from 0-9 on a 7-segment display reinforces understanding of assembly language programming by providing a practical application where students must convert numerical values into machine-readable instructions. This task requires familiarity with binary and hex systems, manipulating PIO 8255 ports, and understanding logical operations like transferring data to specific ports. By writing actual code that physically interacts with hardware, learners can solidify their grasp of programming concepts and hardware interfacing, essential skills in computer engineering .

Providing binary or hex values determines which segments of a 7-segment display are turned on or off. Each segment of the display corresponds to a bit position in a binary or hex value, where a logical 0 activates (turns on) a specific segment. To display a number, the corresponding segments must receive the correct combination of logical 0s, which are provided through the PIO 8255 ports already connected to the 7-segment display. This allows any number from 0 to 9 to be displayed by configuring the appropriate binary or hex value to activate the necessary segments .

To display the digit 3 on a 7-segment display using the given program, the sequence of hexadecimal values involves moving B0h to the register AL and then moving this value to port A. This value represents the necessary logic for activating the segments that visually form the number 3 on the display .

The MDA-8086 trainer kit integrates theoretical knowledge with practical skills by offering a hands-on platform where students can directly apply theoretical concepts of microprocessor interfacing in a controlled environment. This kit allows students to write assembly language programs that manipulate real hardware, providing immediate feedback on their coding and circuit manipulation skills. By interfacing directly with components using precise control operations, students gain comprehensive insights into both high-level programming concepts and low-level machine architecture principles, bridging the gap between theory and practice .

To configure the MDA-8086 trainer kit for programming a 7-segment display, several steps are necessary: 1) Set the kit in PC mode by adjusting the jumper P1; 2) Connect the RS232 cable to the PC; 3) Ensure that the serial monitor status is achieved upon power-up or after pressing the RES key, checking that a message is displayed on the LCD indicating readiness for data communication with the computer; 4) Use wincomm software to set segment and offset, such as E 0000:1000; 5) Enter the machine language code within wincomm; 6) Execute the code by pressing 'G'. These steps allow interfacing with the 7-segment display .

Wincomm software is used in configuring a 7-segment display on the MDA-8086 trainer kit to facilitate communication between the PC and the microcontroller through a serial connection. The software allows users to set memory segments and offsets, input machine language code, and execute commands. This tool is essential for translating and transferring instructions between the user interface on the PC and the microcontroller, ensuring accurate control and display of digits on the 7-segment display .

You might also like