Monday, 30 July 2012

PROGRAMMING THE 8051

To use the 8051 microcontroller, you definitely need to program it first for the intended purpose. What does that mean actually? The 8051 itself is just a piece of hardware capable of doing nothing at all. It is actually the software that makes it intelligent and gives some meaning to its life. The software defines the purpose of the 8051 or solution to a particular problem. Now how to program it? It's very simple to understand.

UPDATE: Visit this link for a newer  and updated version of this post - with detailed instructions.

If we have agreed to the importance of software in the 8051 then we must also agree to the rules for designing some software for it. Here we go

Burning / Programming and HEX files

We all are familiar with the term installing software on our Windows based system but in 8051 microcontroller, we refer to this process as burning / programming the device which is similar to installing some software on it. So let's get used to this terminology. The burning or programming process is accomplished using a burner / programmer which is both combination of hardware and software. When we program the 8051, the code is permanently stored in its ROM (please check here for complete information regarding the ROM in 8051) and will stay there until erased or re-programmed.

A typical 8051 burner

You cannot go on programming it with anything you want. The 8051 can be programmed only with file type known as the HEX files. Don't get confused by the name. Hex files are generated very easily. If you have written a simple program in some language and generated its output then you know what compilation is. If you haven't, I suggest you get familiar with some programming language first. So here is the deal : you write a program for the 8051 in some language and then using specific compilers, you generate a hex file for the code you have written which is ready to be burned.

A windows software for burning 8051

So we conclude that you can program the 8051 only if you have
  • a burner
  • a burning software
  • HEX file compiled for your code
And the rest of the procedure is very simple
  • Mount the 8051 on your burner kit
  • Connect it to computer (depends on the kit)
  • Launch the burning software
  • Follow instructions
For example if you're using EZ-Downloader, then you wait for it to identify your device and once connected, you click SEND and select the HEX file you generated earlier for your code (to be discussed later) and the software will take care of the rest. You will see the progress and get informed once it is completed and burning is verified.

4 comments:

  1. Hello! Could you please let me know whether it'll be possible to burn the 8051 using a serial cable?

    ReplyDelete
    Replies
    1. Nope, that's not entirely possible.

      Delete
  2. what is burner cost

    ReplyDelete