You are on page 1of 26

Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 1

AIM: To understand KEIL software.

PRIMARY KNOWLEDGE FOR HOW TO USE KEIL SOFTWARE...........

>> Open Keil μvison3

In menu bar click on project--> new project

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

>> create a desire folder and give project name. And save.

As seen above select appropriate controller. Here we are selecting 8051 device from ATMEL
Corporation (for example)

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

SELECT AT89C51. Press OK.

When you press OK, this above question is asked, just press yes. Now a window will open
like below.

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

The Red circle indicates Project workspace window.

For adding a file to this workspace; just right click on the source group 1, and select add files to
source group 1. (If you have source file; suppose you don’t have then first you must write the code
and save t with proper format. A new file can be written by selecting FILE menu with new file. )

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

After writing code and adding to project, please build the project. The red circle on above figure
shows direct build option. If u can’t find these symbols then go to project menu and select build
target.

After building up the following screen would be appear, this window is called as output window. If
this window is not present then you can on this screen by selecting

VIEW MENU--->OUTPUT WINDOW

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

After building is done, debugging can be start by selecting start/stop debug session in DEBUG
menu as shown above.

For running code one can select run options in debug menu or directly on screen as shown in below
figure with red circle. The window at the left side contains different registers.

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 2
AIM: Write a first assembly language program that will add 2 16-bit
numbers under the platform of 8051. (2512h & 2616h)

ALP:

TASK 1: Write a code that will save result into internal RAM location 34h and 35h.

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 3

AIM: Write an assembly language program to find minimum number from


given 10 numbers.
ALP:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

TASK1: Explain each and every code statement for the above code.

TASK 2: Write the same code as above to find out the maximum number.

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 4

AIM: Write an assembly language program to convert packed BCD to


ASCII
ALP:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

TASK1: Explain each and every code statement for the above code.

TASK 2: Write the code HEX to ASCII conversion.

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 5

AIM: Developing an assembly language program for Timer module of


8051.

Generate a square wave with an ON time of 3ms and an OFF time of 10ms
on all pins of port0. ASSUME XTAL frequency =11.0592MHz with use of
timer 0 in mode 1.

ALP:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

TASK 1: Do calculation of timer. Draw the the output signal of Port 0

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 6

AIM: To understand Port programming in C.

#include<reg51.h>
void msd(int)
void main()
{
PORT0 = 0x00;
msd(1000);
PORT0=0x0FF;
msd(1000);
}

void msd(int k)
{ int a;
for (a=0;a<k;a++);
}

TASK1: Calculate the delay due to routine msd in keil µvision3.

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

TASK2: From the above calculation generate delay of 10ms.

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 7
AIM: Write a C program to Generate a square of 1KHz at each pins of
Port 1. (Use timer module of 8051)

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 8
AIM: To develop the code for serial communication using RS-232 and
UART module of 8051 using C language.

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 9
AIM: To interface the LCD with 8051 using C language.

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

EXPERIMENT 10

AIM: Stepper motor control with programming in C.

TASK1: Prepare Interfacing requirements from controller side and motor side.
TASK2: Prepare flow chart for control action

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.


Microprocessor & Microcontroller Interfacing (2150907) EE-V

Conclusion:

K J Institute of Engineering and Technology, Savli Electronics & Communication Dept.

You might also like