Lab 5 and 6 Report
Lab 5 and 6 Report
Lab 5 and 6 Report
DISCUSSION:
Following is the summary of introduction to 8051 microcontroller and keil software
8051 Microcontroller:
KEIL Software:
Keil development tools for the 8051 Microcontroller Architecture support every level of
software developer from the professional applications engineer to the student just learning about
embedded software development.
OBJECTIVE:
1. Using microcontroller ports as output
2. Getting introduced to smart-pro 5000u burner and it’s software used to program
3. microcontroller using smart-pro 5000u burner
4. Sending data bytes on data ports of microcontroller
5. Getting introduced to machine cycle and learning to generate desired delay
6. Generating different patterns and displaying the outputs on LEDs
DISCUSSION:
Following is the summary of coding with assembly language using KEIL software:
Assembly Programming:
In computer programming, assembly language often abbreviated asm, is any low-level
programming language in which there is a very strong correspondence between the instructions in
the language and the architecture's machine code instructions. Because assembly depends on the
machine code instructions, every assembler has its own assembly language which is designed for
exactly one specific computer architecture.
A processor understands only machine language instructions, which are strings of 1's and 0's.
However, machine language is too obscure and complex for using in software development. So,
the low-level assembly language is designed for a specific family of processors that represents
various instructions in symbolic code and a more understandable form.
As in figure different types of low level languages and high level languages are shown
How Assembly Language works
Code to blink even and odd LEDs one after the other
Program Code
org 00h
MOV B,#01010101b
MOV p2,B
call delay
jmp repeat
delay:
MOV r6,#230
label2:
MOV r7,#250
label1:
sqqqqqqqqqdjnz r7,label1 //loop to call delay it will run for 230x250 times
djnz r6,label2
ret
end
Question No.1
Proteus circuit
Task#02
Code to blink 8 LEDs in sequence one after the other using setb and clr
instruction.
Program Code
org 00h
repeat:
clr p2.0
clr p2.1
clr p2.2
clr p2.3
clr p2.4
clr p2.5
clr p2.6
setb p2.7
call delay
call delay
call delay
setb p2.6
call delay
call delay
call delay
setb p2.5
call delay
call delay
call delay
setb p2.4
call delay
call delay
call delay
setb p2.3
call delay
call delay
call delay
setb p2.2
call delay
call delay
call delay
setb p2.1
call delay
call delay
call delay
setb p2.0
call delay
call delay
call delay
jmp repeat
delay:
mov r6,#230
label1:
mov r7,#250
label2:
djnz r6,label1
ret
end
Proteus circuit
Task#03
org 00h
mov A,#11111111b
call delay
jmp repeat
delay:
mov r3,#40
L3:
mov r4,230
L2:
mov r5,250
L1:
djnz r5,L1
djnz r4,L2
djnz r3,l3
ret
end
Calculations
Proteus circuit
Task#04
org 00h
mov A,#00000001b
mov p2,A
repeatLEFT:
call delay
rl A
mov p2,A
mov r5,#7
djnz r5,repeatLEFT
mov A,#00000001b
mov p2,A
call delay
call delay
rr A //calling label
mov p2,A
call delay
mov r4,#7
djnz r4,repeatRIGHT
delay:
mov r6,#230
label1:
mov r7,#250
label2:
djnz r6,label1
ret
end
Proteus circuit
Learning Outcomes
The lab achieved the following learning outcomes: