Create Keil Project for 8051 Microcontroller

In this tutorial, we’ll learn how to Create Keil project for 8051 Microcontroller using uVision5. In the end of this lesson, we will generate HEX file to load into Flash Memory of 8051.

Step By Step: Create Keil Project for 8051

STEP1

Before we proceed any further, first launch Keil uVision5 application from computers program menu.

STEP2

Now click on Project tab and select New uVision Project…

Create new Keil Project

STEP3

Give any name to project (Here we have given a name as project). And Save project in new folder.

Name and save Project

STEP4

Now in select Device for Target ‘Target 1’… Search for appropriate derivative from family of 8051 microcontroller (for example: P89V51RD2, AT89C51, AT89S51 etc). Here in this case we have chosen P89V51RD2. As we’ll be experimenting in future with P89V51RD2.

Then select your device and hit on OK.

Select p89v51rd2 Microcontroller

STEP5

When ask for Copy ‘STARTUP.A51’ to Project Folder and Add File to Project? Click NO

Select no. startup file

STEP6

Now to create source file go to File tab and click on New…

Create new source file

STEP7

Here save this file with .c (e.g. LED.c) extension in project folder. which we have created earlier.

Save file as c extensionSave as led.c file

STEP8

At this point, we’re ready to write code/program. Now click on File Extension, Books and Environment… tab

Setup file extension

STEP9

Then click on Add Files…

Add led.c file

Now select file which we have saved with .c extension. Then click on Add button. And then hit onClose.

Add file to project

Here you can see your file gets added in Files: window. Now click OK

STEP10

Now click on Options for Target… tab

Option for Target

In Target window type clock frequency which we’re using for 8051 microcontroller. Throughout this tutorial series we are going to use 11.0592MHz crystal clock.

Target

Now in Output tab click on check box of Create HEX File. Then hit on OK

Create hex file

STEP11

Now click on “Build” tab for building project file. Then click on Rebuild

Rebuild target files

At this point, if there isn’t be any error then we’ll get HEX file into “Objects folder” with .HEX extension. This is how we’ll Create Keil project for 8051 Microcontroller using uVision5. We hope you will find this tutorial educational. Thanks and see you in next tutorial where we’ll explore different features of P89V51RD2-8051 Microcontroller with some cool example projects.

Social

Advertisement

Amazon Associates Disclosure

BINARYUPDATES.COM is a participant in Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com or Amazon.in