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.