Getting Started with Keil uVision

Nilay Banker November 4, 2012 21 Comments

An Introduction to Keil MicroVision

Embedded system means some combination of computer hardware and programmable software which is specially designed for a particular task like  displaying message on LCD. If you are still wondering about an embedded system, just take a look at these circuit applications using 8051 microcontroller. You can call these applications embedded systems as it involves hardware (8051 microcontroller) and software (the code written in assembly language).

1. Voltmeter using 8051

2. Thermometer using 8051

3. Frequency counter using AVR

Some real life examples of embedded systems may involve ticketing machines, vending machines, temperature controlling unit in air conditioners etc. Microcontrollers are nothing without a Program in it.

One  of the important part in making an embedded system is loading the software/program we develop into the microcontroller. Usually it is called “burning software” into the controller. Before “burning a program” into a controller, we must do certain prerequisite operations with the program. This includes writing the program in assembly language or C language in a text editor like notepad, compiling the program in a compiler and finally generating the hex code from the compiled program. Earlier people used different softwares/applications for all these 3 tasks. Writing was done in a text editor like notepad/wordpad, compiling was done using a separate software (probably a dedicated compiler for a particular controller like 8051), converting the assembly code to hex code was done using another software etc.  It takes lot of time and work to do all these separately, especially when the task involves lots of error debugging and reworking on the source code.

Keil MicroVision is a free software which solves many of the pain points for an embedded program developer. This software is an integrated development environment (IDE), which integrated a text editor to write programs, a compiler and it will convert your source code to hex files too.

Here is simple guide to start working with Keil uVision which can be used for

  • Writing programs in C/C++ or Assembly language
  • Compiling and Assembling Programs
  • Debugging program
  • Creating Hex and Axf file
  • Testing your program without Available real Hardware (Simulator Mode)

This is simple guide on Keil uVision 4 though also applicable on previous versions also.

These are the simple steps to get off the mark your inning!

Step 1: After opening Keil uV4, Go to Project tab and

Create new uVision project

Now Select new folder and give name to Project.

Getting started with Keil MicroVision

Step 2: After Creating project now Select your device model. Example.NXP-LPC2148  

[You can change it later from project window.]

Getting started with Keil MicroVision

Step 3: so now your project is created and Message window will appear to add startup file of your Device click on Yes so it will be added to your project folder

Getting started with Keil MicroVision

Step 4: Now go to File and create new file and save it with .C extension if you will write program in C language or save with .asm for assembly language.

i.e., Led.c

Getting started with Keil MicroVision

Step 5: Now write your program and save it again. You can try example given at end of this tutorial.

Step 6: After that on left you see project window [if it’s not there….go to View tab and click on project window]

Now come on Project window.

Introduction to Keil MicroVision

Right click on target and click on options for target

Here you can change your device also.

Introduction to Keil MicroVision

Click output tab here & check create Hex file if you want to generate hex file

Now click on ok so it will save changes.

Introduction to Keil MicroVision

Step 7: Now Expand target and you will see source group

Right click on group and click on Add files to source group

Introduction to Keil MicroVision

Now add your program file which you have written in C/assembly.

You can see program file added under source group.

Step 8: Now Click on Build target.You can find it under Project tab or in toolbar.It can also be done by pressing F7 key.

Introduction to Keil MicroVision

Step 9:  you can see Status of your program in Build output window

[If it’s not there go to view and click on Build output window]   

Introduction to Keil MicroVision

Now you are done with your program. Next time we will look at Debugging and Simulation of Program. Hope you find it helpful.

 

Comments
  • aniket
    September 2, 2015

    thanx….i will prepare good ppt because of this info.

  • Pretty! This has been a really wonderful post. Thank you for providing this information.

  • Ahmed
    May 8, 2015

    I have Keil uVision version 4. I would like to configure it so that I can compile C++ code as well. I believe I can only compile C at the moment. Can anyone help with that?

    Thanks

  • February 17, 2015

    Dear,
    I need source code of the following using 8051 By Keil;
    1) Design half adder using 8051
    2) Design three bit binary to Gray code converter
    3) design 8 bit ring counter

    Kindly help me in this. .
    I’ll be very thankful to you

  • Usha
    January 31, 2015

    Really a good explanation is given very much helpful for the freshers.

  • sanjeev
    January 27, 2015

    what happens whether the startup files did not add to the poject is it necessary or not?

  • October 20, 2014

    Does Keil works on windows7 and windows 8/8.1 ?
    Awaiting for kind reply.
    Thank you.

    • VAIBHAV
      December 19, 2014

      yes….

    • Usha
      January 31, 2015

      yeah it works on 7. I am using it on 7 itself.

  • June 30, 2013

    i need keil for 8051 .

  • sahithi
    May 23, 2013

    good job!

  • Reeya
    November 6, 2012

    Sir i need programme for alarm circuit with controller 8051 and programme should be in keil and using chip AT89s52.
    Thank you
    Reply Soon

    • Arjun .S
      March 7, 2014

      yeah me too ..

  • November 5, 2012

    Sir
    How to get this software?
    Pls info me i need this?
    Thanks

  • Anish
    November 5, 2012

    Fantastic explanation Mr.Nilay

    • Nilay Banker
      November 5, 2012

      Thanks 🙂

  • gobinath
    November 5, 2012

    sir ,may i knw more details abt wrkin of this softwr nd mail me tat details,gobinath1212@gmail.com,,plz…..

  • Rakesh
    November 5, 2012

    Awesome……

    • Nilay Banker
      November 5, 2012

      Thank you dear…First time ever!

Leave a Reply to samarnath dev Cancel reply

Your email address will not be published. Required fields are marked *