You are on page 1of 2

8051[AT89S52]

WORKING WITH KEIL

Creating a New Project :

Step 1 : Open Keil 2(μVision2)

Step 2 : Project New μVision Project Select/Create a Folder Name of

Project Save.

Select Processor:

Step 3 : Select and Expand “ATMAL”Select “89S52” OK


Yes

New Program

Step 4 : File New Write Code


[Include Header file of Processor to be used.
 For” ATMAL89S52” #include <reg52.h>(or) #include <Path of the header file>
 An Embedded Program will generally include an INFINITE loop.
Save : folder save as program files

File Save as Name.c [To save as header: Name.H]

Add Program file to source group :

Right Click on Source group Build Target


 Short Cut: F7.
 Name.axf file will be created.

Debug :

Debug Start/Stop Debug Session


 Short Cut: Ctrl + F5

Simulation :

Peripherals 1. PORTS: (i) Port0 (iii)port2


(ii) Port1 (iv)port3
Stepwise CheckUP
Debug Step.
 Short Cut: F11.
Create Hex Files :

Right Click Target Options for Target ‘Target1’ Out Put

 Create Hex File Select Folder Ok Ok.


Right Click Target Build Target. [Hex file Created].

-----------------------------------------------------------------------
Somarouthu Technologies, #304, Mehtab Arcade, Tarnaka X Roads, Secunderabad-17
98490 55866, 98493 55866, 040-27015320. chipcraftdsp@gmail.com
www.somarouthu.com
8051[AT89S52]

EMBEDDED ‘C’ for 8051


LAB SECESSION1:

Note: Use port0 pins from P0.0 to P0.7 pins


1. Write a program to toggle the on board LED’s with some delay?
(Use port0 pins from 0 to 7 pins)
2. Write a program to toggle alternate on board LED’s with some delay?
(O/p to be toggle D4, D6, D8, D10)
3. Do Left shift operation on board LED’s with some delay?
(First D4 is activated, next D5 to be activated and so on….)
4. Do Right shift operation on board LED’s with some delay?
(First D11 is activated, next D10 to be activated and so on….)
5. Do Right shift operation on Led’s start from D0 and Left shift operation
Led’s till D7.
6. Write an 8051 C program to send values 00 – FF to port P1.
7. Write an 8051 C program to send hex values for ASCII characters of
0, 1, 2, 3, 4, 5, A, B, C, and D to port P1.
8. Write an 8051 C program to toggle alternate bits of P1 continuously.
9. Write an 8051 C program to send values of –4 to +4 to port P1.
10. LEDs are connected to bits P1 and P2. Write an 8051 C program
that shows the count from 0 to FFH (0000 0000 to 1111 1111 in
binary) on the LEDs.

-----------------------------------------------------------------------
Somarouthu Technologies, #304, Mehtab Arcade, Tarnaka X Roads, Secunderabad-17
98490 55866, 98493 55866, 040-27015320. chipcraftdsp@gmail.com
www.somarouthu.com

You might also like