Tribhuvan University Institute of Engineering Pulchowk, Lalipur A Lab Report On Embedded System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING
Pulchowk, Lalipur

A
Lab Report
On
Embedded System
Lab2

Submitted By: Submitted To:


Name: Saroj Kumar Katwal Department of Electronics
Group: B And Computer Engineering
Roll No: 074BCT536
Theory
A microcontroller is designed to be used with several devices and peripherals connected to
it for performing various kinds of tasks. The 8051/8052 microcontroller too possess the ability to
interface with the external peripherals for input and output purposes including the display. For this
purpose, the microcontroller has ports that comprises of Input/output lines. The 8051
microcontroller has 4 I/O ports each of 8-bit input/output lines making in total 32 lines for
interfacing external devices. In this lab, we use the 8051 microcontrollers to interface it with a
simple display device i.e., a 7 segment LED display to display the characters that we desire through
assembly programming.

7 Segment Display:
An LED or Light Emitting Diode, is a solid state optical PN-junction diode which emits
light energy in the form of photons when it is forward biased by a voltage allowing current to flow
across its junction, and in Electronics we call this process electroluminescence.
A seven-segment display is the most basic electronic display device that can display digits
from 0-9. They find wide application in devices that display numeric information like digital
clocks, radio, microwave ovens, electronic meters etc. The most common configuration has an
array of eight LEDs arranged in a special pattern to display these digits. They are laid out as a
squared-off figure 8. Every LED is assigned a name from ’a’ to ’h’ and is identified by its name.
Seven LEDs ’a’ to ’g’ are used to display the numerals while eighth LED ’h’ is used to display the
dot/decimal.
Each one of the seven LEDs in the display is given a positional segment with one of its
connection pins being brought straight out of the rectangular plastic package. These individually
LED pins are labelled from a through to g representing each individual LED. The other LED pins
are connected and wired to form a common pin. So, by forward biasing the appropriate pins of the
LED segments in a particular order, some segments will be light and others will be dark allowing
the desired character pattern of the number to be generated on the display. This then allows us to
display each of the ten decimal digits 0 through to 9 on the same 7-segment display.

Fig. 1. Seven Segment Display

Types of 7 segment display:


The displays common pin is generally used to identify which type of 7-segment display it
is. As each LED has two connecting pins, one called the Anode and the other called the Cathode,
there are therefore two types of LED 7-segment display called: Common Cathode (CC) and
Common Anode (CA).
The difference between the two displays, as their name suggests, is that the common
cathode has all the cathodes of the 7-segments connected directly together and the common anode
has all the anodes of the 7-segments connected and is illuminated as follows.

• Common Cathode:
In the common cathode display, all the cathode connections of the LED segments are joined
together to logic 0 or ground. The individual segments are illuminated by application of a HIGH,
or logic 1 signal via a current limiting resistor to forward bias the individual Anode terminals (a-
g).

Digit dp g f e d c b a Hex
0 0 0 1 1 1 1 1 1 3F
1 0 0 0 0 0 1 1 0 06
2 0 1 0 1 1 0 1 1 5B
3 0 1 0 0 1 1 1 1 4F
4 0 1 1 0 0 1 1 0 66
5 0 1 1 0 1 1 0 1 6D
6 0 1 1 1 1 1 0 1 7D
7 0 0 0 0 0 1 1 1 07
8 0 1 1 1 1 1 1 1 7F
9 0 1 1 0 1 1 1 1 6F
Table. 1. Digital Pattern for Common Cathode Seven Segment Display

• Common Anode:
In the common anode display, all the anode connections of the LED segments are joined together
to logic 1. The individual segments are illuminated by applying a ground, logic 0 or LOW signal
via a suitable current limiting resistor to the Cathode of the segment (a-g).

Digit dp G f e d c b a Hex
0 1 1 0 0 0 0 0 0 C0
1 1 1 1 1 1 0 0 1 F9
2 1 0 1 0 0 1 0 0 A4
3 1 0 1 1 0 0 0 0 B0
4 1 0 0 1 1 0 0 1 99
5 1 0 0 1 0 0 1 0 92
6 1 0 0 0 0 0 1 0 82
7 1 1 1 1 1 0 0 0 F8
8 1 0 0 0 0 0 0 0 80
9 1 0 0 1 0 0 0 0 98
Table. 2. Digital Pattern for Common Anode Seven Segment Display

Software Used:
A. Vision IDE: The Vision IDE from Keil combines project management, make facilities, source
code editing, program debugging, and complete simulation in one powerful environment. The
Vision development platform is easy to use and helping you quickly create embedded programs
that work. The Vision editor and debugger are integrated in a single application that provides a
seamless embedded project development environment.

B. PROTEUS: Proteus is a compilation of program design and simulation electronics developed


by Labcenter Electronics consists of two main programs: ARES and ISIS, and Electra and VSM
modules. We used the following components in Proteus:
 AT89C52
 RN1
 LED-BARGRAPH-RED
 7SEG-MPX4-CC (Common Cathode)

Circuit Diagram

The following circuit schematic diagram was used and simulated in Proteus for the assignments
given in the lab session:
Circuit Explanation:
We had used the common cathode 4x7 segment display in our lab session for which all the
cathode terminals were connected to the common ground. The anode side requires a logic high to
low. The port 0 of the microcontroller is used to output the required character using the 7 segments
while the Port 2 bits i.e., P2.0, P2.1, P2.2, P2.3 selects the required 7 segment display out of the 4
available ones.

Displaying techniques:
There are many techniques to display the output from a single microcontroller like
8051/8052 because of having multiple I/O ports. Some of the techniques are:
i) Multiplexed configuration: Here in our circuit, we have used only one Port to carry data to all 4
seven segment displays despite having four ports. It is so because it leaves other ports to be used
for other purpose and the 4x7 segment display has been developed for that purpose. Multiplexed
configuration uses multiple 7-segment units that share the same data lines. It gives an illusion that
multiple values are displayed at once on multiple 7-segment LED units using shared data lines.
Illusion is created due to persistence of vision i.e. human brain cannot differentiate between two
events occurring at a time difference of less than 40 milliseconds. Values must be sent at a rate of
about 60 to 100 times per second to avoid flickering. The multiple 7-segment units need to be
turned on or off one by one at appropriate times.
ii) Non-Multiplexed configuration: This configuration requires different data lines and multiple 7-
segment units to display multiple values at once. This configuration cannot use shared data lines
between multiple 7-segment LED units to give an illusion of displaying multiple values at once
because of lack of synchronization and delay between consecutive digits.
Code

1.
Assembly Code:

ORG 00H
MOV DPTR,#LABEL1
MOV P2,#0FEH
L: MOV R2,#00H
L1: MOV A,R2
MOVC A,@A+DPTR
MOV P0,A
ACALL DELAY
INC R2
CJNE R2,#0AH,L1
DEC R2

L2: DEC R2
MOV A,R2
MOVC A,@A+DPTR
MOV P0,A
ACALL DELAY
CJNE R2,#01H,L2
SJMP L

DELAY: MOV R3,#7


HERE1: MOV R4,#255
HERE2: MOV R5,#255
HERE3: DJNZ R5,HERE3
DJNZ R4,HERE2
DJNZ R3,HERE1
RET

LABEL1: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H

END
C code:

#include <reg51.h>
unsigned char led_pattern[10] = {0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82H,0XF8,80H,0X90H};

void delay(int time)


{
unsigned int i,j;
for (i=0;i<time;i++)
for (j=0;j<125;j++);
}

void display(int i)
{
P0 = led_pattern[i];
delay(1000);
}

void main(void)
{
unsigned int i;
P2 = 0x01;

while(1)
{
for(i=0; i<10; i++)
display(i);
for(i=8; i>0; i--)
display(i);
}
}
2.
Assembly Code:

ORG 00H
MOV P2,#0FFH
MOV DPTR,#LABEL1
L: MOV P0,#00H
MOV R1,#00H
MOV R2,#00H
MOV R3,#60
MOV R0,#01H
L1: MOV A,R1
CLR P2.1
ACALL DISPLAY
ACALL DELAY
SETB P2.1

MOV A,R2
CLR P2.0
ACALL DISPLAY
ACALL DELAY
SETB P2.0

DJNZ R3,L1
MOV R3,#60

CJNE R2,#02H,L2
MOV R0,#00H

L2: CJNE R0,#01H,L3


INC R1
CJNE R1,#0AH,L1
MOV R1,#00H
INC R2
SJMP L1

L3: DEC R1
CJNE R1,#-1,L1
MOV R1,#09H
DEC R2
CJNE R2,#-1,L1
SJMP L

DISPLAY: MOVC A,@A+DPTR


MOV P0,A
RET

DELAY: MOV R7,#2AH


HERE1: MOV R6,#2BH
HERE2: DJNZ R6,HERE2
DJNZ R7,HERE1
RET

LABEL1: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H

END

C code:
#include <reg51.h>
unsigned char led_pattern[10] = {0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82H,0XF8,80H,0X90H};

void delay(int time){


unsigned int i,j;
for (i=0;i<time;i++)
for (j=0;j<125;j++);
}

void display(unsigned int i){


unsigned int j, led[2];
led[0] = i / 10;
led[1] = i % 10;
for(j=0; j<10; j++) // change limit of j for different delay
for(i=0;i<2;i++){
P2 = 0x1 * (i + 1);
P0 = led_pattern[led[i]];
delay(40);
}
}

void main(void){
unsigned int i;
while(1){
for(i=0; i<20; i++)
display(i);
for(i=20; i>0; i--)
display(i);
}
}
3.
Assembly Code:

ORG 00H
MOV 40H,#10
MOV P2,#0FFH
MOV DPTR,#LABEL1

L: MOV P0,#00H
MOV R0,#00H
MOV R1,#00H
MOV R2,#01H
MOV R3,#0FH
N00: CJNE R0,#00H,N0
MOV B,#00H
SJMP L1
N0: CJNE R0,#01H,N1
MOV B,#01H
SJMP L1
N1: MOV A,R1
ADD A,R2
DA A
XCH A,R2
MOV R1,A
MOV A,R2
MOV B,A

L1: MOV A,B


ANL A,#0FH
CLR P2.1
ACALL DISPLAY
ACALL DELAY
SETB P2.1

MOV A,B
ANL A,#0F0H
SWAP A
CLR P2.0
ACALL DISPLAY
ACALL DELAY
SETB P2.0

DJNZ R3,L1
MOV R3,#0FH

INC R0
MOV A,R0
CJNE A,40H,N0
SJMP L
DISPLAY:
MOVC A,@A+DPTR
MOV P0,A
RET
DELAY: MOV R7,#100
HERE1: MOV R6,#200
HERE2: DJNZ R6,HERE2
DJNZ R7,HERE1
RET
LABEL1: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H

END

C code:
#include <reg51.h>
unsigned char led_pattern[10] = {0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82H,0XF8,80H,0X90H};
void delay(int time){
unsigned int i,j;
for (i=0;i<time;i++)
for (j=0;j<125;j++);
}
void display(unsigned int i){
unsigned int j, led1, led2;
led1 = i / 10;
led2 = i % 10;
for(j=0; j<10; j++) {
P2 = 0x1;
P0 = led_pattern[led1];
delay(40);
P2 = 0x2;
P0 = led_pattern[led2];
delay(40);
}
}
void main(void){
unsigned int i, fibo_seq[N] = {0 , 1};
for(i=2; i<N; i++)
fibo_seq[i] = fibo_seq[i-1] + fibo_seq[i-2];
while(1)
for(i=0; i<N; i++)
display(fibo_seq[i]);
}
4.
Assembly Code:
ORG 00H

MOV 40H,#12
MOV P2,#0FFH
MOV DPTR,#LABEL1

L: MOV P0,#00H
MOV R0,#01H
MOV R3,#2FH

N1: MOV A,40H


MOV B,R0
MUL AB
MOV R1,A
MOV B,#0AH
DIV AB
MOV R1,B
MOV B,#0AH
DIV AB
MOV R2,B
MOV R4,A
MOV A,R2

L1: MOV A,R1


CLR P2.2
ACALL DISPLAY
ACALL DELAY
SETB P2.2

MOV A,R2
CLR P2.1
ACALL DISPLAY
ACALL DELAY
SETB P2.1

MOV A,R4
CLR P2.0
ACALL DISPLAY
ACALL DELAY
SETB P2.0

DJNZ R3,L1
MOV R3,#2FH

INC R0
CJNE R0,#0BH,N1
SJMP L
DISPLAY:
MOVC A,@A+DPTR
MOV P0,A
RET

DELAY: MOV R7,#1FH


HERE1: MOV R6,#1FH
HERE2: DJNZ R6,HERE2
DJNZ R7,HERE1
RET

LABEL1: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H

END

C code:
#include <reg51.h>
unsigned char led_pattern[10] = {0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82H,0XF8,80H,0X90H};
void delay(int time){
unsigned int i,j;
for (i=0;i<time;i++)
for (j=0;j<125;j++);
}

void display(unsigned int i){


unsigned int j;
for(j=0; j<15; j++)
{
P2 = 0x1;
P0 = led_pattern[i / 10];
delay(40);

P2 = 0x2;
P0 = led_pattern[i % 10];
delay(40);
}
}

void main(void){
unsigned int i;
while(1)
for(i=1; i<=10; i++)
display(N*i);
}
5.
Assembly Code:
ORG 00H
MOV P2,#0FFH
MOV DPTR,#LABEL1
L: MOV P0,#00H
MOV R5,#25
MOV R0,#00
L1: MOV A,#03H
ADD A,R0
CLR P2.3
ACALL DISPLAY
ACALL DELAY
SETB P2.3
MOV A,#02H
ADD A,R0
CLR P2.2
ACALL DISPLAY
ACALL DELAY
SETB P2.2
MOV A,#01H
ADD A,R0
CLR P2.1
ACALL DISPLAY
ACALL DELAY
SETB P2.1
MOV A,#00H
ADD A,R0
CLR P2.0
ACALL DISPLAY
ACALL DELAY
SETB P2.0
DJNZ R5,L1
MOV R5,#25
MOV A,R0
ADD A,#04H
MOV R0,A
CJNE R0,#10H,L1
MOV R0,#00H
MOV P0,#0FFH
SJMP L1

DISPLAY: MOVC A,@A+DPTR


MOV P0,A
RET

DELAY: MOV R7,#1FH


HERE1: MOV R6,#1AH
HERE2: DJNZ R6,HERE2
DJNZ R7,HERE1
RET

LABEL1: DB 0C6H,92H,0B0H,0B0H,0C6H,92H,0B0H,99H,0C6H,92H,0B0H,92H,0C6H,92H,0B0H,82H

END

C code:
#include <reg51.h>
unsigned char led_pattern[10] = {0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82H,0XF8,80H,0X90H};
unsigned char dept_init = 0XC6;
void delay(int time){
unsigned int i,j;
for (i=0; i<time; i++)
for (j=0; j<125; j++);
}
void display(unsigned int i){
unsigned int j, led2, led3, led4;
led2 = i / 100;
led3 = (i - led2 * 100) / 10;
led4 = i - led2 * 100 - led3 * 10;
for(j=0; j<20; j++) {
P2 = 0x1;
P0 = dept_init;
delay(10);
P2 = 0x2;
P0 = led_pattern[led2];
delay(10);
P2 = 0x4;
P0 = led_pattern[led3];
delay(10);
P2 = 0x8;
P0 = led_pattern[led4];
delay(10);
}
}

void main(void)
{
unsigned int i;
unsigned int roll_no[4] = {533, 534, 535, 536};
while(1)
for(i=0; i<4; i++)
display(roll_no[i]);
}
6.
Assembly Code:
ORG 00H
MOV P2,#0FFH
MOV DPTR,#LABEL1
MOV R1,#00H
MOV P0,#00H
MOV R5,#28H

L1: MOV A,R1


ADD A,#03H
MOV B,#16
DIV AB
MOV A,B
CLR P2.3
ACALL DISPLAY
ACALL DELAY
SETB P2.3
MOV A,R1
ADD A,#02H
MOV B,#16
DIV AB
MOV A,B
CLR P2.2
ACALL DISPLAY
ACALL DELAY
SETB P2.2
MOV A,R1
ADD A,#01H
MOV B,#16
DIV AB
MOV A,B
CLR P2.1
ACALL DISPLAY
ACALL DELAY
SETB P2.1
MOV A,R1
ADD A,#00H
MOV B,#16
DIV AB
MOV A,B
CLR P2.0
ACALL DISPLAY
ACALL DELAY
SETB P2.0
DJNZ R5,L1
MOV R5,#28H
INC R1
CJNE R1,#16,L1
MOV R1,#00H
SJMP L1
DISPLAY: MOVC A,@A+DPTR
MOV P0,A
RET
DELAY: MOV R7,#0FH
HERE1: MOV R6,#0AH
HERE2: DJNZ R6,HERE2
DJNZ R7,HERE1
RET
LABEL1: DB 0C6H,92H,0B0H,30H,0C6H,92H,0B0H,19H,0C6H,92H,0B0H,12H,0C6H,92H,0B0H,02H
END

C code:
#include <reg51.h>
Unsigned char led_pattern[10] =
{0XC6,0X92,0XB0,0X30, 0XC6,0X92,0XB0,0X19, 0XC6,0X92,0XB0,0X12, 0XC6,0X92,0XB0,0X02, };
void delay(int time)
{
unsigned int i,j;
for (i=0; i<time; i++)
for (j=0; j<125; j++);
}

void display(unsigned int i)


{
unsigned int j;
for(j=0; j<20; j++) // change limit of j for different delay
{
P2 = 0x1;
P0 = scroll_pattern[i-4];
delay(10);

P2 = 0x2;
P0 = scroll_pattern[i-3];
delay(10);

P2 = 0x4;
P0 = scroll_pattern[i-2];
delay(10);

P2 = 0x8;
P0 = scroll_pattern[i-1];
delay(10);
}
}
1 1 16 16
1 16 1 16 1 16 1 16
2 2 15 15 1 16
2 15 2 15 2 15 2 15
3 3 14 14 2 15
3 14 3 14 3 14 3 14
4 4 13 13 3 14
4 13 4 13 4 13 4 13
5 5 12 12 4 13
5 12 5 12 5 12 5 12
6 6 11 11 5 12
6 11 6 11 6 11 6 11
7 7 10 10 6 11
7 10 7 10 7 10 7 10
8 8 9 9 7 10
8 9 8 9 8 9 8 9
8 9

10k
10k
10k
10k
10k

10k

10k

RN1
RN1
RN1
RN1
RN1

RN1

RN1
}
{

1:

2:
Output:
while(1)
void main(void)

unsigned int i;

1 16 1 16 1 16
2 15 2 15 2 15
1 16 1 16 3 14 3 14 3 14
1 16
2 15 4 13 4 13 4 13
2 2 15 15
3 14 5 12 5 12 5 12
3 3 14 14
4 13 6 11 6 11 6 11
4 4 13 13
5 12 7 10 7 10 7 10
5 5 12 12
6 11 8 9 8 9 8 9
6 6 11 11
7 7 10 10 7 10
8 8 9 9 8 9
display(i);

10k
10k
10k
for(i=4; i<20; i++)

RN1
RN1
RN1

10k

10k
10k
RN1

RN1
RN1
1 16 1 16 1 16
2 15 2 15 2 15
3 14 3 14 3 14
1 1 16 16 1 16 4 13 4 13 4 13
2 2 15 15 2 15 5 12 5 12 5 12
3 3 14 14 3 14 6 11 6 11 6 11
4 4 13 13 4 13 7 10 7 10 7 10
5 5 12 12 5 12 8 9 8 9 8 9
6 6 11 11 6 11
7 7 10 10 7 10
10k

10k
10k
8 8 9 9 8 9
RN1

RN1
RN1

10k

10k
10k

RN1
RN1
RN1
1 16 1 16 1 16
1 16 1 16 1 16 1 16 2 15 2 15 2 15
2 15 2 15 2 15 2 15 3 14 3 14 3 14
3 14 3 14 3 14 3 14 4 13 4 13 4 13
4 13 4 13 4 13 4 13 5 12 5 12 5 12
5 12 5 12 5 12 5 12 6 11 6 11 6 11
6 11 6 11 6 11 6 11 7 10 7 10 7 10
7 10 7 10 7 10 7 10 8 9 8 9 8 9
8 9 8 9 8 9 8 9

10k
10k
10k

10k
10k
10k
10k
RN1
RN1
RN1

RN1
RN1
RN1
RN1
3:

4:
1 16 1 16 1 16 1 16 1 16
2 15 2 15 2 15 2 15
2 15
3 14 3 14 3 14 3 14
3 14
4 13 4 13 4 13 4 13 4 13
5 12 5 12 5 12 5 12 5 12
6 11 6 11 6 11 6 11 6 11
7 10 7 10 7 10 7 10 7 10
8 9 8 9 8 9 8 9 8 9
10k

10k

10k
10k
10k
RN1

RN1

RN1
RN1
RN1
1 16 1 16 1 16
2 15 2 15 2 15 1 16
1 16
3 14 3 14 3 14 2 15
2 15
4 13 4 13 4 13 3 14
3 14
5 12 5 12 5 12 4 13
4 13
6 11 6 11 6 11 5 12
5 12
7 10 7 10 7 10 6 11
6 11
8 9 8 9 8 9 7 10
7 10
8 9
8 9

10k
10k
10k
10k

10k

RN1
RN1
RN1
RN1

RN1
5.

6.
Discussion
Assignment 1:
Single digit decimal counter: The counter counts from (0)10 to (9)10 and once the counter reaches
the maximum value (9)10, it counts back to (0)10. For this purpose, we used a 7-segment LED unit
with non-multiplexed configuration to display the count value. Under non-multiplexed
configuration, it necessitates different data lines and multiple 7-segment units to display multiple
values at once. This configuration cannot use shared data lines between multiple 7-segment LED
units to give an illusion of displaying multiple values at once because of lack of synchronization
and delay between consecutive digits. An appropriate timing interval was implemented between
each count value writing proper delay codes. Port 0 (P0) of the 8051 microcontroller was used to
send the count value to a single 7segment LED unit while pin zero of port 2 (P2.0) was used to
activate a single 7-segment LED unit. The counting process was repeated indefinitely by executing
the whole piece of code in a loop.

Assignment 2:
Double digit decimal counter: The counter counts from (00)10 to (20)10 and once the counter
reaches the maximum value of (20)10, it counts back to (00)10. This counting process was repeated
indefinitely by executing the entire program in a repeated loop. For this purpose, we used two 7-
segment LED units in multiplexed configuration to display the count value. Multiplexed
configuration uses multiple 7-segment units that share the same data lines. It gives an illusion that
multiple values are displayed at once on multiple 7-segment LED units using shared data lines.
Illusion is created due to persistence of vision i.e. human brain cannot differentiate between two
events occurring at a time difference of less than 40 milliseconds. Hence, we passed the values at
the rate of about 60 to 100 times per second to avoid flickering. The multiple 7-segment units were
turned on and off one by one at appropriate times. Similarly, we used port 0 (P0) of the 8051
microcontrollers to send the count value to the two 7-segment LED units while pins zero and one
of port two (P2.0 and P2.1) were used to activate two 7-segment LED units.

Assignment 3:
Displaying first N numbers of Fibonacci sequence: The number N=7 in our case was stored in
memory location 40h and we used the decimal numbering system to display the sequence. Port 0
(P0) of the microcontroller was used to send the numbers to 7-segment LED units while pins zero
and one of port two (P2.0 and P2.1) were used to activate two 7-segment LED units.

Assignment 4:
Generate the multiplication table of a number (N) stored in memory location 3AH which is (9)10
in our case. We used an approach of repetitive addition for generating the multiplication table of a
number stored. Besides, binary to BCD conversion and display subroutine were written for
displaying equivalent decimal value through port 0 (P0) of the microcontroller used to send the
numbers to 7-segment LED units. Pins of port two i.e. P2.0, P2.1 and P2.2 were used to activate
the required 7-segment LED units since only three 7-segment LED units are needed since the
multiple of number cannot exceed more than that.
Assignment 5:
Displaying roll numbers of lab group members in static format:
Roll Numbers: C533, C534, C535, C536.
Multiplexed configuration was used to display the roll number continuously in four 7-segment
units and appropriate timing interval was maintained between each roll number. The port 0 (P0) of
the microcontroller was used to send roll number to the four 7-segment LED units while pins of
port 2 i.e. P2.0, P2.1, P2.2 and P2.3 were used to activate four 7-segment LED units. The memory
location value was manipulated in the group of four in the static format for displaying the roll
numbers in static fashion and hence the counter value set to 4 initially.

Assignment 6:
Displaying the roll numbers of lab group members in scrolling format.
Roll Numbers: C533, C534, C535, C536.
The roll numbers were scrolled towards the left and separated by using decimal point (DP). The
scrolling process was carried out indefinitely by executing the entire program in a repeated loop.
Multiplexed configuration was used to display the roll number continuously in four 7-segment
units and appropriate timing interval was maintained between each roll number. The port 0 (P0) of
the microcontroller was used to send roll number to the four 7segment LED units while pins of
port 2 i.e. P2.0, P2.1, P2.2 and P2.3 were used to activate four 7-segment LED units. For displaying
the roll numbers in scrolling fashion, the counter value was set to 10H and the counter value is
incremented by unit rather than treated as a group.

Conclusion:
In this lab session, we became familiar with interfacing 7-segment LED display with 8051/52
microcontroller. We came to know that there can be two sort of seven segment display namely,
common cathode and common anode seven segment display and the respective digital drive
pattern differ in two systems. Two different configurations i.e. non-multiplexed and multiplexed
configuration displaying in static and scrolling fashion were encoded for the given lab
assignments.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy