Add8 (Just A Name) in The Main Directory RT. Create A New Directory in E Drive in Your Name, Say RT
Add8 (Just A Name) in The Main Directory RT. Create A New Directory in E Drive in Your Name, Say RT
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 called
add8 (just a name) in the main directory RT. 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 directory
RT.
While assembling the program, MPLAB will create several files with name extensions like LST,
HEX, ERR etc in the same sub-directory.
1) Double click the MPLAB icon on desktop. The screen will appear as shown below
8) Select New, and then select assembler, the screen will appear as below
11) Save your program with the same name and in the same sub directory.
12) Now click on Project on the tool bar.
13) From the drop down menu, select Add 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.
16) From the drop down menu, select Build all to assemble the file.
17) If there is no error, Build succeeded will appear, Otherwise the number and types of errors
occurred will appear in the window as shown below
20) From the new window select the device 16F877 and say OK
21) This is to select the appropriate SFRs for the selected device.
27) Select Special Function Registers from the same drop down menu
28) Two new windows will appear, displaying the content of file registers and SFR.
Now press the key F7 to execute one instruction in the program in a single step mode of operation.
Repeatedly press F7 to execute other instructions.
Check file registers and Special Function Registers to 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. The
add8.hex is needed to be downloaded into the kit using any serial software.
For downloading your HEX file into the kit, connect the kit in USB mode with the computer.
Click Load HEX file, then select the required HEX file from the sub-directory
Click on Oscillator and select option XT.
Click on WRITE option in the PICFlash2 programmer window for downloading your hex file.
Press RESET key in the kit to execute the program and the see/observe the result.