Professional Documents
Culture Documents
INTRODUCTION TO PROTEUS:-
ISIS & ARES CORE APPLICATIONS:
PROTEUS VSM
Cpu models for pic24f04ka200, pic24f04ka201, pic24f08ka101,
pic24f08ka102, pic24f16ka101, pic24f16ka102
Vsm studio* - an ide for proteus vsm that greatly simplifies the
process building your source code and attaching the object
code to a schematic. More information about vsm studio may
be found here.
The mikroc PRO for 8051 is a powerful, feature-rich development tool 8051
microcontrollers. It is designed to provide the programmer with the
easiest possible solution to developing applications for embedded
systems, without compromising performance or control.
FEATURES
Mikroc PRO for 8051 allows you to quickly develop and deploy
complex applications:
Write your C source code using the built-in Code Editor (Code and
Parameter Assistants, Code Folding, Syntax Highlighting, Auto
Correct, Code Templates, and more.)
Get detailed reports and graphs: RAM and ROM map, code statistics,
assembly listing, calling tree, and more.
The following table shows the Keil C51 Product Line (across the top)
and the Components that are included (along the left side). You may
use this information to find the development tool kit that best fits
your needs.
Lab No # 12
USE THE PORTS AS OUTPUT BY INVERTING ITS
BITS AFTER CERTAIN DELAY TIME
AIM:-
There are some main tasks in this lab that I have to
perform.
To write a program in Keil using assembly language to
toggle the bits at Port 1 after a certain delay.
To implement any of the above program on AT89C51 -
processor in Proteus Software.
ALGORITHM:-
Start the program from 00H.
Move 55H to port 1.
Delay will be call.
Move 55H to port 1.
Delay will be call.
Short jump in main
Delay Subroutine will be
Move 255 value to R1.
Move 255 value to R2.
Move 7 value to R2.
Decrement R3 and jump to again3.
Decrement R2 and jump to again2.
Decrement R1 and jump to again1.
Return the subroutine.
End the program.
PROGRAM:-
Program on Keil Using Assembly Language:
ORG 00H
AGAIN1: MOV R2, #225 ; Runs 255 times, Delay 306u Sec
END
OBSERVATION:-
P1 === 55H
P1 == AAH
RESUTL:-
Use the ports as output by inverting its bits.
SOFTWARE PICTURE:-
Program in Keil
Proteus 7 Professional
Lab No # 13
TO USE PORTS AS INPUT AND OUTPUT IN
PIC MICROCONTROLLERS
AIM:-
To use the PORT B as input and PORT D as an output of a
PIC microcontroller (P18F452).
ALGORITHM:-
Start the program from main ().
TRISB to OXFF;
TRISB to OX00;
While loop is infinity time.
Port B to Port D.
PROGRAM:-
Program on microC PRO Language:
void main()
{
TRISB=0xFF; // declaring PORT B as input
While (1)
{
PORTD=PORTB ;
} // Move the input to output
}
OBSERVATION:-
First we have to declare Port B as the
input port and PORT D as the output port. Now connect the crystal
to microcontroller and a reset switch which is active High switch.
Connect the LEDs at the output to check your result.
RESUTL:-
To use ports as input and output in two pic
microcontrollers
SOFTWARE PICTURE:-
Program in Keil
Proteus 7 Professional
Lab No # 15
TO USE PORTS AS INPUT AND OUTPUT &
INTERCONNECT TWO PIC
MICROCONTROLLERS
AIM:-
Use two PIC u-controllers. Give input at first and take
output from second.
ALGORITHM:-
Start the program from main ().
TRISB to OXFF;
TRISB to OX00;
While loop is infinity time.
Port B to Port D.
PROGRAM:-
Program on microC PRO Language:
void main()
{
TRISB=0xFF; // declaring PORT B as input
While (1)
{
PORTD=PORTB ;
} // Move the input to output
}
OBSERVATION:-
First of all we have to declare
Port B of 1st u-controller as input and Port D as the output
in the 1st program. Then declare the Port B of 2nd u-
controller as the input and the Port C as output in the 2 nd
program.
RESUTL:-
To use ports as input and output in pic
microcontrollers
SOFTWARE PICTURE:-
Program in Keil
Proteus 7 Professional
Lab No # 16
TO MADE THE TWO TRAFFIC SIGNAL
LIGHTS SUCH THAT ONLY ONE WAY IS ON
AIM:-
We have to make the circuit such that One Way traffic is
on at a time.
ALGORITHM:-
Define Red1 and Red2 on P1.0 and P2.0.
Define Y1 and Y2 on P1.1 and P2.1.
Define G1 and G2 on P1.2 and P2.2.
Start main and the while loop for infinitely.
Initially all the lights are off except the Red1 and Green 2
Delay for 10 sec so that the lights are on
Green of 1st is off
Yellow of 1st is on
Yellow of 2nd is on
Delay for 2 sec Red of 1st is off
Yellow of 1st is off
Yellow of 2nd is off
Green of 1st is on
Red of 2nd is on
Delay for 10 sec
Green of 1st is off
Yellow of 1st is on
Yellow of 2nd is on
Delay for 2 sec
End the program
PROGRAM:-
Program on C Language:
void main() {
Red2=1; // initially all the lights are off except the Red1 and Green 2
RESUTL:-
We have to make the programming such that on
way is on at a time. The below programming shows that initially Red
light of 1st Signal is on and at same time Green of 2nd is on for 10 sec
. Now then Yellow and Red of 1st is on (to show that ready to go) and
at same time only yellow of 2nd is on (to show that ready to stop) for
2 sec. Now the Red of 2nd and green of 1st is on at the same time for
10 sec. Then the only the yellow of 1st (to show that ready to stop)
and the Red & Yellow of 2nd is on (to show that ready to go) for 2 sec
and then Red of 1st with green of 2nd and so on.
SOFTWARE PICTURE:-
Program in microC PRO
Proteus 7 Professional
Lab No # 17
TO USE THE INTERRUPTS IN MICKROC
AIM:-
Write a C program that continuously gets a single bat of
data from P1.7 and send it to P2.0 in the main while simultaneously
creating a square wave of 200us period on P2.5 and sending a
Latter A to the serial port. Use timer 0 to create the square wave.
Assume that XTAL=11.0592MHz. Use 9600 baud rate.
PROGRAM:-
Program on C Language:
}
void serial0(void) org 0x0023
{if (trans==1)
trans=0;
else
{recv=0;}
void main() {
input=1;
TMOD=0x22;
TH1=253;
TH0=0xA4;
strt0=1;
strt1=1;
SCON=0x50;
IE=0x92;
while(1){
output=input;
}
SOFTWARE PICTURE:-
Proteus 7 Professional
Lab No # 18
TO INTERFACE MICROCONTROLLER WITH
LCD USING MIKROC
AIM:-
How to interface the LCD with 8051 and PIC Microcontroller.
PROGRAM:-
sbit LCD_RS at P2_0_bit; // defining RS
void main() {
RESUTL:-
First we will make the programming for 8051 such that firstly clear the LCD
(using command, for command RS=0) and then display the output (RS=1) and then stop
the curser which is blinking (RS=0).
SOFTWARE PICTURE:-
ALGORITHM:-
Start from 00H.
Clear the carry.
Move 25H to accumulator.
Move 45H to R1.
Adding them.
Move 2300H to data pointer.
Move accumulator value to data pointer memory address.
End the program.
PROGRAM:-
Program on Keil Using Assembly Language:
ORG 00H
CLR C
MOV A # 25H
MOV R1 # 45H
ADD A, R1
MOVX @DPTR, A
END
OBSERVATION:-
Input
A == 25H
R1 = 45H
Output
A = 6AH
RESUTL:-
Addition of two 8-bit numbers.
SOFTWARE PICTURE:-
Program in Keil
Lab No # 20
TO PERFORM SUBTRACTION OF TWO 8
BIT NUMBER USING 8051 INSTRUCTION
SET
AIM:-
To perform subtraction of two 8-bit numbers using 8051
instruction set
ALGORITHM:-
Start from 00H.
Clear the carry.
Move 75H to accumulator.
Move 45H to R1.
Subtracting them.
Move 2300H to data pointer.
Move accumulator value to data pointer memory address.
End the program.
PROGRAM:-
Program on Keil Using Assembly Language:
ORG 00H
CLR C
MOV A # 75H
MOV R1 # 45H
SUBB A, R1
MOV DPTR, #2300H
MOVX @DPTR, A
END
OBSERVATION:-
Input
A == 75H
R1 = 45H
Output
A = 30H
RESUTL:-
Subtraction of two 8-bit numbers.
SOFTWARE PICTURE:-
Program in Keil
LAB NO # 21
TO PERFORM MULTIPLICATION OF TWO 8
BIT NUMBER USING 8051 INSTRUCTION
SET
AIM:-
To perform multiplication of two 8-bit numbers using
8051 instruction set
ALGORITHM:-
Start from 00H.
Clear the carry.
Move 75H to accumulator.
Move 45H to R1.
Multiplying them.
Move 2300H to data pointer.
Move accumulator value to data pointer memory address.
End the program.
PROGRAM:-
Program on Keil Using Assembly Language:
ORG 00H
CLR C
MOV A # 75H
MOV B # 45H
MUL AB
MOV DPTR, #2300H
MOVX @DPTR, A
MOV A, B
MOVX @DPTR, A
END
OBVESATION:-
Input
A == 75H
B = 45H
Output
A = BA H
B = 00 H
RESUTL:-
Multiplication of two 8-bit numbers.
SOFTWARE PICTURE:-
Program in Keil
LAB NO # 22
TO PERFORM DIVISION OF TWO 8 BIT
NUMBER USING 8051 INSTRUCTION SET
AIM:-
To perform division of two 8-bit numbers using 8051
instruction set
ALGORITHM:-
Start from 00H.
Clear the carry.
Move 80H to accumulator.
Move 02H to B.
Diving them.
Move 2300H to data pointer.
Move accumulator value to data pointer memory address.
End the program.
PROGRAM:-
Program on Keil Using Assembly Language:
ORG 00H
CLR C
MOV A # 80H
MOV B # 02H
DIV AB
MOV DPTR, #2300H
MOVX @DPTR, A
MOV A, B
MOVX @DPTR, A
END
OBVESATION:-
Input
A == 80H
B = 02H
Output
A = 40 H
B = 00 H
RESUTL:-
Division of two 8-bit numbers.
SOFTWARE PICTURE:-
Program in Keil