17
HOW TO USE KEIL Finally you have decided to write your own code for the 8051 microcontroller. It doesn't matter whether you have chosen Assembly or C Language for yourself but what matters now is that you need an environment specially designed for 8051. Basically you are looking out for IDE (Integrated Development Environment) that will help you build and compile programs. While there are many options out there, I prefer KEIL uVision in this regard. KEIL IDE is basically an assembler and a compiler or whatever you name it. You can write either an Assembly or C language code and KEIL will take care of the rest for you. Furthermore, it supports many of the 8051 variants that you will face. You can download KEIL from their official website using the link below. DOWNLOAD KEIL uVISION FOR 8051 After successful download and install, you may have problem getting familiar with it if you're using it for the very first time but don't worry because I am here to give you a graphical tutorial on how to use it for writing your program, compiling it, and finally generating the HEX file. Here we go

HOW TO USE KEIL

  • Upload
    pepgote

  • View
    38

  • Download
    1

Embed Size (px)

Citation preview

HOW TO USE KEIL

HOW TO USE KEIL

Finally you have decided to write your own code for the 8051 microcontroller. It doesn't matter whether you have chosen Assembly or C Language for yourself but what matters now is that you need an environment specially designed for 8051. Basically you are looking out for IDE (Integrated Development Environment) that will help you build and compile programs. While there are many options out there, I preferKEIL uVision in this regard.

KEIL IDEis basically an assembler and a compiler or whatever you name it.You can write either an Assembly or C language code and KEIL will take care of the rest for you. Furthermore, it supports many of the 8051 variants that you will face. You can download KEIL from their official website using the link below.

DOWNLOAD KEIL uVISION FOR 8051After successful download and install, you may have problem getting familiar with it if you're using it for the very first time but don't worry because I am here to give you a graphical tutorial on how to use it for writing your program, compiling it, and finally generating the HEX file.

Here we go

Create a new folder for project to avoid getting mixed up with files

PROJECT > NEW uVISION PROJECT

Give some name and click SAVE

when prompted, select proper device that you're using ( i-e ATMEL > AT89C51 )

When prompted, select YES

Click NEW button and write your code (Assembly or C language)

SAVE the file with proper extension as above

The code you have written gets highlighted

Right click SOURCE GROUP 1 as shown

Add the code you have written into the Project workspace

Go to options for the project

Enable HEX file generation

Build the project

Notice successful build. Ignore the warnings

Use this HEX file to program your IC

These are the simple steps for a successful compilation and generation of HEX file. Now I hope you have created your first HEX file and ready to program it to the 8051. And you know how to do that, right? If your answer is no then please check this out.

UPDATE:

If you have trouble understanding the pictures then here is a video of the same process that I made. Hope you get a better view this time

Email This

HYPERLINK "http://www.blogger.com/share-post.g?blogID=4407293474928454432&postID=9050160236370299852&target=blog" \o "BlogThis!" \t "_blank" BlogThis!

HYPERLINK "http://www.blogger.com/share-post.g?blogID=4407293474928454432&postID=9050160236370299852&target=twitter" \o "Share to Twitter" \t "_blank" Share to Twitter

HYPERLINK "http://www.blogger.com/share-post.g?blogID=4407293474928454432&postID=9050160236370299852&target=facebook" \o "Share to Facebook" \t "_blank" Share to Facebook

HYPERLINK "http://www.blogger.com/share-post.g?blogID=4407293474928454432&postID=9050160236370299852&target=pinterest" \o "Share to Pinterest" \t "_blank" Share to PinterestLabels: keil, programming, software 15 comments:

1. KingAhmad8/05/2013 11:07 pmI'm trying to generate a random number in C language using keil 4 C51. I'm using rand() and appropriate header files that we use in ordinary C compiler. A random number is generated in ordinary c compiler but not in keil 4... Please help me to resolve this!

ReplyReplies1. 805112/15/2013 4:38 pmSorry for the delay. For some reason, your comment had moved to SPAM section :(

Well I haven't checked Random Number Generation in 8051 myself but I could give you an appropriate suggestion :

Forget about using the C header files for random number generation in 8051. You can always use the timers for the same purpose. Depending on the range, you can either go for 8bit mode (0-255) or 16bit mode (0-65535). Reading the timer/counter value at any instant will give you a random number in that range depending on it's state at that time.

The only trick is that if you want a specific range for Random Number Generation, you will have to write your own algorithm for manipulating the above basic procedure for that range.

(hint: keep reading the timer/counter value until it returns some number within that range)

Reply2. Abdul Haseeb12/15/2013 3:43 pm(y)

ReplyReplies1. 805112/15/2013 4:24 pm:)

Reply3. Ravi chaudhari2/06/2014 11:36 pmGreat work but why my u vision is not showing any AT89CXXX file in atmel part... please he me with this...and please upload or send me your u vision by mail [email protected] or FB.com/rvch7 please help...You are Great..!!

ReplyReplies1. 80512/07/2014 12:08 pmAre you using the latest version?

2. 80512/07/2014 12:21 pmCheck your inbox Ravi

Reply4. Bala Murugan2/16/2014 8:45 amhi admin, you just write in .hex code procedure, bt i want to program in C language means ?wat i do ? wil u explain the procedure ??

ReplyReplies1. 80512/16/2014 5:28 pmI also upload the program code where necessary. You can check my posts about interfacing such LED, SWITCH, KEYPAD etc and read the program code with it. I have properly commented it so you can have an idea of what's happening.

If you want to properly learn Embedded C language for 8051, you must refer to the book

"The 8051 Microcontroller and Embedded. Systems. Using Assembly and C"By Muhammad Ali Mazidi and Janice Gillispie Mazidi

Reply5. CoolOmya3/18/2014 11:33 amhi sir, can you tell me how to check your code inside keil (i heard it is possible), before burning i want to check weather the code is working accordingly or not....

ReplyReplies1. 80513/18/2014 9:17 pmYou can always debug your code in Keil which will help you analyse your code in a stepwise fashion. I have already posted about debugging in Keil, check the link below

Debugging in KeilReply6. Anonymous5/17/2014 5:41 pmI have just started to learn 8051 microcontroller and at the end of the semester I have to submit a project on embedded system . for that what will be the best project ?can you give me any advice?

ReplyReplies1. 80515/17/2014 8:37 pmI'm afraid I can't tell you about the 'best' project :) because every project is unique and has some usefulness in its own way. However you can check out this list of projects based on 8051 microcontroller. Maybe you can grab yourself the 'best' one ;)

Projects based on 8051Reply7. CHINMAYEE7/16/2014 2:03 pmsir,i m persuing my btech fourth year .i dont know any basics about keil software but we are supposed to do a project on 8051 mc which need this software to write the programm could u please sujjest us how could we get our program sucessmy project is "ZIGBEE BASED GENSET CONTROLL SYATEM".

ReplyReplies1. 80517/17/2014 5:48 pmIt becomes easier if you divide your project into smaller parts and verify it in a stepwise fashion.

If you have no idea about KEIL or 8051, it would be a good idea to know them first and work on some basic tasks. Then you can continue to tackle your project requirements when you get the hold of it.

_1477385224.bin

Attribute VB_Name = "ThisDocument"Attribute VB_Base = "1Normal.ThisDocument"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = TrueAttribute VB_Customizable = TrueAttribute VB_Control = "DefaultOcxName, 0, 0, ShockwaveFlashObjects, ShockwaveFlash"