7 Simple Steps to Flash a Program into Microcontroller


step by step tutorial to flash microcontroller


Programming the microcontroller is one of the basic step while designing an embedded system. Here in this tutorial, i am presenting you on How to burn a program into the microcontroller as step by step. For that i am using Keil microvision software. I hope this tutorial will help all the Electronics and Communication Engineering students for doing their mini projects.


An embedded system can be defined as a combination of some Hardware and Software, which is used to perform a single well defined task. Generally, an embedded system consisting of a processor, associated peripherals (Input/output ports, lcd display, led indicator or some secondary storage devices) and software used for doing a specified purpose.



For designing a project in embedded system, you should have a clear idea about the following questions;

  • What is the purpose of this project?
  • What are the inputs to the system?
  • What are the outputs from the system?
  • Why i am choosing this processor?

By answering these questions you can simply design the Circuit diagram. The circuit must be the one which clearly defines each and every part of the system. The input/output of the system should be interfaced with any of the available ports. In AT89S52 (8051) microcontroller, their are three ports (each ports carry 8 pins, hence total 24 i/o pins) available in which we can configure them as either input or output. 
The input to the device may be from sensors, transducers or by means of a keypad and the output from the device will be given to an alarm, controlling section or to drive any other devices.


7 Basic Steps to Program a Microcontroller.


1. Write down the program, to be performed in embedded C language.

2. Compile the program by using any suitable  compiler, here we are using keil microvision software.

3. Correct the errors in the program, if any, that will shown after compiling the program.

4. Simulate the program, to check any logical errors by defining the input/output ports that is while writing the program. (This step is an optional one, you can ignore it)

5. Generate the Hex file and save it in your computer.

6. Interface a suitable programming kit with the computer and cross check the connections.

7. By using the software, that you will get while buying the programmer kit, load the hex file into the microcontroller.

That's it, now you are successively burned the program into microcontroller. After that, verify the working by connecting the microcontroller into the target system. If necessary you can re-program the microcontroller with required corrections.


Comments

  1. I am newbie, and learning 8051 with embeeded C,

    i have a query to ask,

    lets say, i have 3 different programs
    1> LCD 16X2
    2>ADC 0808 temperature measurement
    3>Heart beat monitoring.

    now i know they can be written in keil microvision software, but
    I am confused, that when normally when we compile+link+obj+hex and burn the microcontroller with one HEX file,
    now how to deal with 3 or more different programs.
    each program is using different ports of 8051 (0,1,2 and 3)

    can anyone pls clear my doubts.
    Thanks,

    ReplyDelete
    Replies
    1. I am not too good in this technology.
      What happens if u run the program serially? If i/ps and o/ps ports are different.
      Pl mail me ur answer to my email a/c santhoshkantharaj@gmail.com.

      Delete
  2. hi
    I am getting a problem in burning my program. The message displayed is "double check your connections" .I have checked my connections but not able to burn the program.I am newbie and I have learnt this a month ago.

    ReplyDelete
  3. can you please mail me the programme to turn on and off the led when the ultrasonic sensor get triggered in avr my mail id is praveenraturi3@yahoo.com

    ReplyDelete

Post a Comment