You are on page 1of 9

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.

UPDATE: You can also click this link for an updated version of this post.

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
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.

You might also like