Microcontroller Programming in Assembly language PART 1

November 2, 2008 by
Filed under: Pic Programing 

Microcontroller Programming in Assembly language PART 1

In this ‘Microcontroller Programming in Assembly language’ series of articles, I would like to show you the way to write an assembly program for a PIC, known as microcontroller commonly, using mpasm assembly in MPLAB. I used PIC16F84A for this purpose. By referring this series of articles one can get an idea on how to begin programming in assembly language for PICs. To give an idea about ‘Microcontroller Programming in Assembly language’ I will take small assembly programs and describe their functionality one by one.


First of all, a project has to be built using MPLAB. So in this first part of the article I will show you to how to create a project using MPLAB.

To start using MPLAB, it has to be installed in the computer.

Download MPLAB >>

Step 1

Open MPLAB. You will see a screen like below.

mplab-ide

Step 2

After you have to go to Project-> Project wizard. Screen will appear as below.

Click next.

mplab-ide1

Step 3

After clicking next, the following screen will appear and in here the PIC which is going to be used has to be selected. Select PIC16F84A and click next.

mplab-ide2

Step 4

Then the following screen will appear on the screen.

In here you have to do several things.

  • Check whether the ‘Active Toolsuite’ is selected as ‘Microchip MPASM toolsuite’
  • If the toolsuite is properly selected screen must as above. Otherwise ‘a cross mark’ will appear in front of each ‘Toolsuite contents’ which are listed below.
    • MPASM Assembler (mpasmwin.exe)
    • MPLINK Object linker (mplink.exe)
    • MPLIB Librarian (mplib.exe)

So if a ‘cross mark’ appears in each toolsuite contents browse the folder which they include using ‘Browse’ button appears below. Assume that the MPLAB is installed to the ‘C drive’ of your machine, then the location of the toolsuite contents will be “C:\Program Files\Microchip\MPASM Suite”.

mplab-ide3

Step 5

After completing the step 4 below screen will appear and give a proper name to your project and select the location in which the project will be saved and simply click next.

mplab-ide4

Step 6

If you already have any previously written assembly program and if you want to add it to your project you can add it here. Simply select the location where it exists and press ‘Add’ and after adding click next. But if you do not have anything to add simply click next.

mplab-ide5

Step 7

Creating a project is almost finished now. In this screen you will see a summary of Device (type of PIC used), Toolsuite and the location of the project saved. If anything needs to be changed go back otherwise click Finish.

mplab-ide6

So, this is the way you have to create a project usiing MPLAB and after creating the project you can add source files to it and it will be discussed in the next article.

Continue to PART 2>>

Other related Articles

PIC Programming for beginners with PIC16F84A

Beginner guide to PIC Programming

Parallel Port Programming in Visual Basic

Related E-Books downloads

Micro controllers in practice by Loan Susnea and Marian Mitescu

PIC in practice by David W. Smith

The PIC Microcontroller; Your Personal Introductory Course by John Morton

Programming and Customising the PIC Microcontroller by Myke Predko

Pick’n up the Pace - Microcontroller Application Guide by Walter G. Jung

Introduction to Microprocessors and Microcontrollers by John Crisp

PIC Microcontrollers Second Edition - An Introduction to Microelectronics by  Martin P. Bates

Download more e-books and software>>

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

Comments

9 Comments on Microcontroller Programming in Assembly language PART 1

  1. meganet on Sun, 2nd Nov 2008 7:08 pm
  2. good job

    [...] Microcontroller Programming in assembly language PART 1 [...]

    [...] Microcontroller Programming in assembly language PART 1 [...]

  3. NKhan on Sat, 29th Nov 2008 9:09 pm
  4. exellent help for poor community, having exellent skill but can’t afford the software & books

  5. lieben on Tue, 3rd Mar 2009 7:22 pm
  6. Interessante Informationen.

  7. KrisBelucci on Tue, 2nd Jun 2009 7:29 am
  8. Great post! Just wanted to let you know you have a new subscriber- me!

  9. PeterMontee on Fri, 3rd Jul 2009 9:34 am
  10. It is already far not exception

  11. KonstantinMiller on Mon, 6th Jul 2009 7:03 pm
  12. How soon will you update your blog? I’m interested in reading some more information on this issue.

  13. ????? ???????? on Fri, 19th Mar 2010 2:00 am
  14. I used PIC16F84A for this purpose. By referring this series of articles one can […….

    ??? ?? ???….

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