8051 – Create a Project

Hi All…. Today we will see How to create project in Keil IDE.

In the last post we have seen how to install keil IDE to develop 8051 projects. If you aren’t seen that please see that by clicking Here.If you want to see the Introduction of Embedded system and 8051 please click Here.

So today we are going to create the project in Keil. I have shown step by step process of creating a single project with images. Here we go.

How to create project in Keil IDE

1. Open the application which we were installed previously by double click.

1-1-300x201 8051 - Create a Project

2. After opening just click the project. That i’ve mentioned with red circle.

2-1 8051 - Create a Project

3. Then click New Project

3-1 8051 - Create a Project

4. Create the folder (directory) where ever you want to save the project. Then give project name. In my case i gave first_project as my project name. You can give whatever name you want. Then click save button.

4-1 8051 - Create a Project

5. After saving that project this window will pop up. So here we need to select our microcontroller. Our case is 8051. Just scroll down and find Atmel.

5-1 8051 - Create a Project

6. Double click the Atmel. Then again scroll until you found AT89C51.

6-1 8051 - Create a Project

7. Click AT89C51 and click ok.

7-1 8051 - Create a Project

8. Click Yes. It will add the startup code to the project.

8-1 8051 - Create a Project

9. So until now we have created the project for 8051 microcontroller.

9-1 8051 - Create a Project

10. Project has been Created. Now we need to create the file for edit our code. Click File then click New.

10 8051 - Create a Project

11. We created file for edit our code.

11 8051 - Create a Project

  1. Now we are going to save our code. Click File and Save.

12 8051 - Create a Project

  1. Give the code name. Here i’m giving just code.c. You can give whatever you want. But you should mention with .c. Because this is C language code (Embedded C).

13 8051 - Create a Project

14. So now our project name is first_project and code name is code.c.

14 8051 - Create a Project

15. As of now we have created project and code. But now we have to put the code inside into the project.For that double click the Source Group1.

15 8051 - Create a Project

16. It will pop up in your project folder. Find your code. In our case we can see code.c there. So click code and click Add.

16 8051 - Create a Project

17. See there our code is added into the project (Source Group1). Then click Close.

17 8051 - Create a Project

18. In that file you can edit your code. This is demo. So i entered only main function and header file. Nothing in that code. So it wont do anything in the 8051. In this code section you have to write your project code based on your application you need.

18 8051 - Create a Project

19. After editing your code we have to set the clock frequency. So click Project and Options for Targer ‘Target 1’.

19 8051 - Create a Project

20. It will pop up one window. There find the Xtal(MHz). In that box enter 11.0592. Do you have any guess why should we enter this value? Because 8051’s clock frequency is 11.0592MHz.

20 8051 - Create a Project

21. After that click Output. There find Create HEX file. Then check that box. Then click Ok. Why we need to select this Create HEX file? We can’t flash our code or project into the 8051 microcontroller. We have to flash the hex file. If we enable this we can get the hex file whenever we build our project.

21 8051 - Create a Project

22. Now i’m going to build my project. Shortcut is F7.

22 8051 - Create a Project

23. After built you can see the error and warnings in the bottom of the window.

23 8051 - Create a Project

24. Open your project folder. Find the hex file. That is the final file which is going to flash into the 8051. you can flash this hex file using any flasher with proper setup.

24 8051 - Create a Project

Thanks for Reading 🙂 . If you have any doubt please comment below. Our next post will be LED blinking using 8051.

Download our new Android app. You can learn all Embedded Tutorials from your Android Phone easily.

Click Here to Download App!