Professional Documents
Culture Documents
Lab4 - Seven Segment Display
Lab4 - Seven Segment Display
Lab4 - Seven Segment Display
LAB 4
SEVEN SEGMENT DISPLAY
Objective:
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:
* 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
QUESTION 1:
Create a program that will display the following sequence:-