Microcontroller Programming

November 15, 2008 by
Filed under: Pic Programing 

Microcontroller Programming

There are lot of things have to be considered when devices are made using microcontrollers. In here such several issues will be discussed on Microcontroller Programming.

Steps of Microcontroller Programming

  • Get an idea about what is going to be done using Microcontroller
  • Dividing the problem in to smaller parts for the ease of solving
  • Programming using assembly
  • Converting the program in to a hex code which can be understood by the Microcontroller
  • Programming Microcontroller using hardware




Explaining the problem

This thing will be somewhat strange for us for some distance. Since lot of high level languages like Visual Basic are used very commonly and they can be easily understandable and easily changeable according to our need. Explaining the problem is not very much necessary. But when a language like ‘assembler’ or ‘C’ is used, situation is totally different. Problem definition is very much needed since they are more hardware related and understanding is somewhat hard comparing high level. It will be very much handy if a prototype of the problem is built in solving it.

Then the amount of inputs, outputs and processing steps needed for the system which is going to be built can be identified easily. This is necessary if assembly language is used to program. Because in assembly sets of instructions are used in controlling all the things which is different from all other languages.

Dividing the problem in to several parts

Dividing the problem which has to be solved in to several smaller parts is very much useful in solving it because it will enable us to figure out it easily. An algorithm has to be built. When the programming is being done, it can be divided in to,

  • Main processing steps
  • Identifying main variables
  • Preparing mainline logic

By understanding the above mentioned steps and by going according to them, the main advantage that can be get out of it will be the optimizing the memory of the microcontroller. That will be very much important in a microcontroller like PIC16F84A since it only has 1kB of limited memory to deal with.

Programming using Assembly

This is the final step after doing all the above mentioned steps. We discuss assembly language for this purpose.

Firstly Assembly program is written and with the help of an assembler it can be converted in to a hex file which can be identified by a microcontroller. Then that hex code is fed in to the memory of the microcontroller using a programmer. Normally microcontroller is connected with a PC using a programmer and this programmer normally uses serial or parallel port in a PC to connect.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Comments

3 Comments on Microcontroller Programming

  1. hingis on Tue, 12th May 2009 6:55 pm
  2. this is a good explain about how programming should be carried out, from now on, i will try to do better dividing..

  3. Kylie BattName on Sun, 11th Apr 2010 9:06 am
  4. ????????? ? ???? ????????. ???? ???????, ???????? ? ????….

    ???????
    Microcontroller Programming
    There are lot of things have to be considered when devices are made using microcontrollers…..

  5. Kylie Batt on Thu, 13th May 2010 3:06 am
  6. ??????? ? ????? ????? ?? ??? ????….

    ???????? ????????? ????, ???????? ?? ????????, ???????????, ??????????? ?????????
    Microcontroller Programming
    There are lot of …

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!