0% found this document useful (0 votes)
145 views3 pages

Lab4 - Seven Segment Display

This document describes a lab experiment on using a seven segment display with a microprocessor. It includes the objective to familiarize with seven segment displays, a list of required equipment, an introduction to seven segment displays, and a procedure to write and run a program that displays different numbers on four seven segment displays by manipulating register values. The program displays the values 5263 on one set of displays, then 1643 on the next set, repeating in a loop with a 1 second delay between each set.

Uploaded by

Fauzan Ariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views3 pages

Lab4 - Seven Segment Display

This document describes a lab experiment on using a seven segment display with a microprocessor. It includes the objective to familiarize with seven segment displays, a list of required equipment, an introduction to seven segment displays, and a procedure to write and run a program that displays different numbers on four seven segment displays by manipulating register values. The program displays the values 5263 on one set of displays, then 1643 on the next set, repeating in a loop with a 1 second delay between each set.

Uploaded by

Fauzan Ariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

BMEE

MARINE ELECTRICAL ELECTRONIC TECHNOLOGY


LEB 40503

LAB 4
SEVEN SEGMENT DISPLAY

Objective:

 To familiarize with the function of seven segment display

List of equipment and materials:

S/N Item

1. Text Editor
2. JP3 – ON
3. JP4 – OFF
4. JP5 – ON
5. JP6 – ON
6. JP7 - ON
7. Remainder – OFF

INTRODUCTION:
A seven-segment-display, or seven-segment indicator, is a electronic display device for displaying
decimal numerals. Current application board consist of quad seven segment display that able to count
from 0 to 9999. It can also simulate clock as well.

The flowchart to display two sets of digits over seven segment display is shown in Figure 1 below:-

Figure 1

PROCEDURE:

LAB 4 LEB 40503 – MICROPROCESSOR BASED SYSTEM PAGE 1/3


BMEE
MARINE ELECTRICAL ELECTRONIC TECHNOLOGY

1. Enter the following program.

* Program Lab 4
* Purpose VTES 68K V.38 Display value of D0,D1,D2,D3 to respective seven segment display
ORG $400400
INIT MOVEA.L #$800001,A0 * base address of pi/t
MOVE.B #$80,+$C(A0 ) * set port A control reg mode 1x
MOVE.B #$0,+$4(A0) * set port A data reg to i/p
MOVE.B #$80,+$E(A0) * set port B control reg to mode 1x
MOVE.B #$FF,+$6(A0) * set port B data reg to o/p
MOVE.B #$0,+$12(A0) * turn off port B
NUM1 BSR MOV1 * Move to display
BSR DISP * Display all value
BSR DELA * 1 seconds
BSR DELA * 1 seconds
NUM2 BSR MOV2
BSR DISP * Display all value
BSR DELA * 1 seconds
BSR DELA * 1 seconds
BRA NUM1
MOV1 MOVE.B #5,D0 * LSB display
MOVE.B #2,D1 * 2nd display
MOVE.B #6,D2 * 3rd display
MOVE.B #3,D3 * MSB display
RTS
MOV2 MOVE.B #1,D0 * LSB display
MOVE.B #6,D1 * 2nd display
MOVE.B #3,D2 * 3rd display
MOVE.B #4,D3 * MSB display
RTS
DISP MOVE.B #$0,+$12(A0) * turn off port A, clear all display
OR.B #$F0,+$12(A0) * Off select, depends upon the BCD code
MOVE.B D0,D4
ADDI #$E0,D4 * MSB select

LAB 4 LEB 40503 – MICROPROCESSOR BASED SYSTEM PAGE 2/3


BMEE
MARINE ELECTRICAL ELECTRONIC TECHNOLOGY

MOVE.B D4,+$12(A0) * move first digit into seven segment


OR.B #$F0,+$12(A0) * Off select, depends upon the BCD code
MOVE.B D1,D4
ADDI #$D0,D4 *
MOVE.B D4,+$12(A0) * move second digit into seven segment
OR.B #$F0,+$12(A0) * Off select, depends upon the BCD code
MOVE.B D2,D4
ADDI #$B0,D4 *
MOVE.B D4,+$12(A0) * move third digit into seven segment
OR.B #$F0,+$12(A0) * Off select, depends upon the BCD code
MOVE.B D3,D4
ADDI #$70,D4 * LSB select
MOVE.B D4,+$12(A0) * move fourth digit into seven segment
OR.B #$F0,+$12(A0) * Off select, depends upon the BCD code
RTS
DELA MOVE.L #551800,D6 * load D6 with a fix value for 0.1 sec
DEL1 SUBQ.L #1,D6 * do a counting loop
BNE DEL1
RTS
END

2. Compile, download and execute (GO 400400) the program.


3. Return to the prompt V> by pressing the reset button on the VTES M68K V.38 board, followed by
ENTER on the PC.

QUESTION 1:
Create a program that will display the following sequence:-

LAB 4 LEB 40503 – MICROPROCESSOR BASED SYSTEM PAGE 3/3

You might also like