CHAPTER 5 MPLAB Introduction 5.1 Installing the MPLAB program package 5.2 Introduction to MPLAB 5.3 Choosing the development mode 5.4 Designing a project 5.5 Designing new assembler file 5.6 Writing a program 5.7 MPSIM simulator 5.8 Toolbar Introduction MPLAB is a Windows program package that makes writing and developing a program easier. It could best be described as developing environment for some standard program language that is intended for programming a PC computer. Some operations which were done from the instruction line with a large number of parameters until the discovery of IDE "Integrated Development Environment" are now made easier by using the MPLAB. Still, our tastes differ, so even today some programmers prefer the standard editors and compilers from instruction line. In any case, the written program is legible, and well documented help is also available. 5.1 Installing the program -MPLAB MPLAB consists of several parts: - Grouping the files of the same project into one project (Project Manager) - Generating and processing a program (Text Editor) - Simulator of the written program used for simulating program function on the microcontroller. Besides these, there are support systems for Microchip products such as PICStart Plus and ICD (In Circuit Debugger). As this book does not cover these , they will be mentioned only as options. Minimal computer requirements for staring the MPLAB are: · PC compatible computer 486 or higher · Microsoft Windows 3.1x or Windows 95 and new versions of the Windows operating system · VGA graphic card · 8MB memory (32MB recommended) · 20MB space on hard disc · Mouse In order to start the MPLAB we need to install it. Installing is a process of copying MPLAB files from the CD onto a hard disc of your computer. There is an option on each new window which helps you return to a previous one, so errors should not present a problem or become a stressful experience. Installment itself works much the same as installment of most Windows programs. First you get the Welcome screen, then you can choose the options followed by installment itself, and, in the end, you get the message which says your installed program is ready to start. Steps for installing MPLAB: 1. Moving the Microsoft Windows 2. Put the Microchip CD disc into CD ROM 3. Click on START in the bottom left corner of the screen and choose the RUN option 4. Click on BROWSE and select CD ROM drive of your computer. 5. Find directory called MPLAB on your CD ROM 6. Click on SETUP.EXE and then on OK . 7. Click again on OK in your RUN window Installing begins after these seven steps. The following pictures explain the meaning of certain installment steps. Welcome screen at the beginning of MPLAB installment At the very beginning, it is necessary to select those MPLAB components we will be working with. Since we don't have any original Microchip hardware components such as programmers or emulators, we will only install MPLAB environment, Assembler, Simulator and the instructions. Selecting components of MPLAB developing environment As it is assumed you will work in Windows 95 ( or a newer operating system), everything in connection with DOS operating system has been taken out during selection of assembler language. However, if you still wish to work in DOS, you need to deselect all options connected with Windows, and choose the components appropriate for DOS. Selecting the assembler and the operating system Like any other program, MPLAB should be installed into some directory. This option can change into any directory on any hard disc of your computer. If you don't have a more pressing need, it should be left at selected place. Choosing the directory where MPLAB will be installed Users who have already had MPLAB (older version than this one) need the following option. The purpose of this option is to save copies of all files which are modified during a changeover to a new MPLAB version. In our case we should leave selected NO because of presumption that this is your first installment of MPLAB on your computer. Option for users who are installing a new version over an already installed MPLAB Start menu is a group of program pointers, and is selected by clicking on START option in the lower left corner of the screen. Since MPLAB will be started from here, we need to leave this option as it is. Adding the MPLAB to the start menu Location that will be mentioned from here on, has to do with a part of MPLAB whose explanation we don't need to get into. By selecting a special directory , MPLAB will keep all files in connection with the linker in a separate directory. Determining a directory for linker files Every Windows program has system files usually stored in a directory containing Windows program. After a number of different installments, the Windows directory becomes overcrowded and too big. Thus, some programs allow for their system files to be kept in same directories with programs. MPLAB is an example of such program, and the bottom option should be selected. Selecting a directory for system files After all of the above steps, installment begins by clicking on 'Next'. Screen prior to installment Installment doesn't take long, and the process of copying the files can be viewed on a small window in the right corner of the screen. Installment flow After installment is completed, there are two dialog screens, one for the last minute information regarding program versions and corrections, and the other is a welcome screen. If text files (Readme.txt) have opened, they need to be closed. Last minute information regarding program versions and corrections. By clicking on Finish, installment of MPLAB is finished.