Position: Index > Unclassified >

PROCEDURE TO USE MPLAB SIM

2018-01-30 18:01  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

Related Articles

PERIPHERAL INTERFACE CONTROLLER (PIC)

INTRODUCTION TO PIC 16F877

PIC PROGRAMMING INSTRUCTION SETS

The first step is to install MPLAB SIM software in your PC, then create a new sub-directory in the main directory RT.

For example, in order to write a program to do mathematical addition, create a sub directory calledadd8(just a name) in the main directoryRT. Create a new directory in E drive in your name, say RT for every program

Similarly, to write any program, create a new sub-directory with suitable name in the main directoryRT.

While assembling the program,MPLABwill create several files with name extensions likeLST, HEX, ERRetc in the same sub-directory.

1)? Double click theMPLABicon on desktop. The screen will appear as shown below

Procedure to use MPLAB SIM

2)???? In the tool bar, selectProject.

3)???? Drop down menu will appear

4)???? Selectnewproject.

The screen will appear as shown below

PROCEDURE TO USE MPLAB SIM

5)???? In the project directory form space, typeE:/ RT / add8. Similarly in the project name type the same nameadd8

PROCEDURE TO USE MPLAB SIM

6)???? From the tool bar selectFile.

7)???? A drop-down menu will appear

8)???? SelectNew, and then selectassembler, the screen will appear as below

PROCEDURE TO USE MPLAB SIM

9)???? Type your program in the window

10)???? The screen will appear as shown below

PROCEDURE TO USE MPLAB SIM 5

11)????Saveyour program with the same name and in the same sub directory.

12)???? Now click onProjecton the tool bar.

13)???? From the drop down menu, selectAdd file to project.

14)???? In the left hand side of the screen, below the source file, the file name which you just saved will appear.

The screen will appear as shown below

MPLAB SIM procedure

15)???? Click onProjectfrom the tool bar.

16)???? From the drop down menu, selectBuild allto assemble the file.

17)???? If there is no error,Build succeededwill appear, Otherwise the number and types of errors occurred will appear in the window as shown below

MPLAB Procedure

18)???? SelectConfigurefrom the tool bar.

19)???? From the drop-down menu selectDevice

20)???? From the new window select the device16F877and say OK

21)???? This is to select the appropriateSFRs for the selected device.

22)???? SelectDebuggerfrom the tool bar

23)???? Select ?Select Toolfrom the drop down menu

24)???? SelectMPSIMfrom the sub menu.

25)???? SelectViewfrom the tool bar

26) selectFile Registersfrom the drop down menu

27) SelectSpecial Function Registersfrom the same drop down menu

28) Two new windows will appear, displaying the content of file registers and SFR.

The screen will appear as shown below

procedure mplab

29)???? SelectWindowfrom the tool bar

30)???? Selecttile horizontallyoption

The screen will appear as shown below

MPLAB SIM Procedure

31) Select Debugger from the tool bar

32) select Reset from the drop down menu

33) Select Processor Reset from the sub menu

procedure for MPLAB SIM

Now press the keyF7to execute one instruction in the program in a single step mode of operation. Repeatedly pressF7to execute other instructions.

Checkfile registersandSpecial Function Registersto verify the result of executing each instructions till the end of the program.

After assembling the program, the MPLAB generates other files in the same sub-directory. Theadd8.hexis needed to be downloaded into the kit using any serial software.

For downloading yourHEXfile into the kit, connect the kit in USB mode with the computer.

Select and double click onPICFlash2.exefile on the desktop.

A window will appear as shown in the figure below

MPLAB

ClickLoad HEXfile, then select the required HEX file from the sub-directory

Click onOscillatorand select optionXT.

Click onWRITEoption in the PICFlash2 programmer window for downloading your hex file.

Now the hex file gets down-loaded into the kit.

PressRESETkey in the kit to execute the program and the see/observe the result.

 

2)SelectWindowfrom the tool bar

3)Selecttile horizontallyoption

 

The screen will appear as shown below


Reprinted Url Of This Article:
http://www.circuitstoday.com/procedure-to-use-mplab-sim