You are on page 1of 10

Microcontrollers and its

Applications

Name: Atul Kumar Dwivedi


Reg. No.- 17BEC0813
Slot : G2
1. A 7-Segment LED display is connected to Port 2 of an 8051 microcontroller
as shown in fig below.

Write an 8051 program to display the digits 1→ 2 → 8 → 1……. Continuously with time
interval as shown in figure.

Solution:

I have used common anode 7-segment display for interfacing to the 8051
microcontroller and have written the code for the same.

To display digits on the 7-segment display we have to pass these hex codes:

Digits Hex Code


0 0xC0
1 0xF9
2 0xA4
3 0xB0
4 0x99
5 0x92
6 0x82
7 0xF8
8 0x80
9 0x90

17BEC0813
Manual Calculation:

17BEC0813
Assembly Program:

ORG 000H ;initial starting address

MOV TMOD,#01H ; Initializing Timer0 in mode 1;

START:

MOV A,#0F9H ; Passing hex value for displaying 1 in common anode 7-segment display.

MOV P0,A ; Moving the value of acc to port P0.

ACALL DELAY1 ; Introducing delay of 1 sec.

MOV A,#0A4H ; Passing hex value for displaying 2 in common anode 7-segment display.

MOV P0,A ; Moving the value of acc to port P0.

ACALL DELAY2 ; Introducing delay of 2 sec.

MOV A,#80H ; Passing hex value for displaying 2 in common anode 7-segment display.

MOV P0,A ; Moving the value of acc to port P0.

ACALL DELAY3 ; Introducing delay of 3 sec.

SJMP START ; Continuing the program endlessly.

// subroutine for delay of 1 sec.

DELAY1:

MOV R0,#14 ; Initializing loop variable as 14

LOOP1:MOV TH0,#00H ; Initializing TH0 as 00

MOV TL0,#00H ; Initializing TL0 as 00

SETB TR0 ; Starting the Timer0

WAIT1:JNB TF0,WAIT1 ; Monitoring Timer flag

CLR TR0 ; Stopping the Timer

17BEC0813
CLR TF0 ; Clearing the Timer flag

DJNZ R0,LOOP1; ; Checking stopping condition of loop

RET

// subroutine for delay of 2 sec.

DELAY2:

MOV R0,#28; ; Initializing loop variable as 28

LOOP2:MOV TH0,#00H ; Initializing TH0 as 00

MOV TL0,#00H ; Initializing TL0 as 00

SETB TR0 ; Starting the Timer0

WAIT2:JNB TF0,WAIT2 ; Monitoring the Timer Flag

CLR TR0 ; Stopping the Timer

CLR TF0 ; Clearing the Timer Flag

DJNZ R0,LOOP2 ; Checking stopping condition of loop

RET

// subroutine for delay of 3 sec.

DELAY3:

MOV R0,#42; ; Inititalizing loop variable as 42

LOOP3:MOV TH0,#00H ; Initializing TH0 as 00

MOV TL0,#00H ; Initializing TL0 as 00

SETB TR0 ; Start the Timer0

WAIT3:JNB TF0,WAIT3 ; Monitoring the Timer Flag

17BEC0813
CLR TR0 ; Stopping the timer

CLR TF0 ; Clearing the timer Flag

DJNZ R0,LOOP3; ; Checking stopping condition of loop

RET

END

Screen Shot of the Program in Keil:

17BEC0813
Output in Keil:

17BEC0813
Interfacing of common anode- 7 segment display in proteus:

Output in Proteus:

17BEC0813
17BEC0813
2. List out the difference between ARM7 and Intel I (i3, i5, i7) Series Processor.
Solution:

The major difference between ARM7 and Intel i-series processors is that former is
RISC (Reduced Instruction Set Computing) and the latter is CISC (Complex
Instruction Set Computing). RISC instruction sets are more atomic and CISC
instruction sets are larger and more complex.
Another main difference is ARM7 processor is very power efficient processor where
as intel processors mainly focuses on high performance.
Other differences are mentioned in the table given below.

Parameter ARM7 INTEL i Series


Core i3 Core i4 Core i5
Architecture RISC CISC CISC CISC
Type 32 – bit 64 – bit 64 – bit 64 – bit
Number of - 2 4 4
Cores
Clock Speed 40MHz – 59.8 3.4GHz – 2.4GHz – 3.8 2.9GHz – 4.2
MHz 4.2GHz GHz GHz
Turbo Boost No No Yes Yes
Cache 8 KB 3 – 4MB 4 – 6MB 8MB
Memory
Hyper – No Yes No Yes
Threading

*****

17BEC0813

You might also like