8051 Coding using keil
For
coding 8051 microcontroller in C language, I use Keil, because it is freeware
and easy to use. In Keil you can code in C and assembly both languages. So
let’s start coding with Keil compiler.
You
can download the latest Keil ide by this link…………………………
In
this link C51 is for 8051. So click on C51. After clicking C51 this page will
appear…..
In
this above page fill all the information what is asking for. If you do not have
any company name then write any name. If you cannot find your state in the
state combo box, the select any state from the list. After filling this form
click on submit button and you will see this page…….
Then
your download will begin. Download it and install it.
After
installing it open Keil. If you want to code for a new project, then open Keil.
Then …..
1>
Click on Project
2>
Then click on New Project….or New uVersion Project
3>
After clicking that a new window will be appeared (creat new
project)
In this window at save combo box you have to select the
folder where you want to save your project. After selecting your project file
write a project name in the file name combo box. Then click on save button.
After clicking on save a new window will be appeared named Select
Device For Target ‘Traget1’
In this window you have to select your device. Suppose you
want Atmel AT89s52. Then first you have to click on Atmel. Then select your
device. In this practice session I am selecting AT89s52.
So click on AT89s52.
After selecting your chosen device click on ok button.
After clicking OK
button a new window will be appeared. It is a discretional window
containing YES and NO
button click on YES button.
After clicking Yes button the project window will be
appeared. But at this moment you can not write your code.
Now from the menu bar click on File and then click on New (ctrl+N). Like
that…
Now you can see a folder named “terget1” . Left side
of that Target1 folder a “+” sign is visible. Click on that + sign
Now you can see a folder named Source Group1. Right
click on that folder (not on the + sign ). After right clicking on that folder
you can see many options like build target, rebuild target, etc. click on
Add Files to Group ‘Source Group1’ .Then a window will be appeared like that;;
In this window at File Name combo box write a name (like
code.c), then click on Add button. After clicking on Add button click on close
button.
Now you have done all the hard work. Now you can write your
code on the text pad.
Now write your code in textpad. When you think you have finished
your code writing then find Build icon and click on that.
It will compile your code whether your code is right or
wrong, if wrong then in which line of that code is wrong and what is the thing you have made wrong.
When your code will
100% correct the message will show you that your code have o-errors and 0-warnings.
Then you can use it for microcontroller.
If you cannot understand or there is some problem, please
comment, I will answer your question within 24 hours.…..
No comments:
Post a Comment