A thing then using MPLAB or MPLABX. You should ALWAYS work with a project. This video will show how to create a assembler project in MPLABX https://www.youtube.com/watch?v=IQcpr9h5MN4 If you program in assembler I will also highly recommend using a template file those are found in folder ......\Microchip\MPLABX\mpasmx\templates\Code your file will be the "18F8722TEMP.ASM" Copy the content of this file into your assembler file. You can use drag and drop into MPlabx. Then copy the conntent and close it. As you will not change the template file. The template file look this
Setting the config bits is very important. MPLABX can do it for you. Take a look here section 4 to 7 http://microchip.wikidot.com/tls0101:config-bits-lab Then you are done you delete the old ones and use copy and paste of the new ones into your code
Hope this get you started
Rich (BB code):
;******************************************************************************
; This file is a basic template for assembly code for a PIC18F8722. Copy *
; this file into your project directory and modify or add to it as needed. *
; *
; Refer to the MPASM User's Guide for additional information on the *
; features of the assembler. *
; *
; Refer to the PIC18FX627/X722 Data Sheet for additional *
; information on the architecture and instruction set. *
; *
;******************************************************************************
; *
; Filename: *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
;******************************************************************************
; *
; Files Required: P18F8722.INC *
; *
;******************************************************************************
LIST P=18F8722 ;directive to define processor
#include <P18F8722.INC> ;processor specific variable definitions
;******************************************************************************
;Configuration bits
;Microchip has changed the format for defining the configuration bits, please
;see the .inc file for futher details on notation. Below are a few examples.
; Oscillator Selection:
CONFIG OSC = LP ;LP
;******************************************************************************
;Variable definitions
; These variables are only needed if low priority interrupts are used.
; More variables may be needed to store other special function registers used
; in the interrupt routines.
CBLOCK 0x080
WREG_TEMP ;variable used for context saving
STATUS_TEMP ;variable used for context saving
BSR_TEMP ;variable used for context saving
ENDC
CBLOCK 0x000
EXAMPLE ;example of a variable in access RAM
ENDC
;******************************************************************************
;EEPROM data
; Data to be programmed into the Data EEPROM is defined here
ORG 0xf00000
DE "Test Data",0,1,2,3,4,5
;******************************************************************************
;Reset vector
; This code will start executing when a reset occurs.
ORG 0x0000
goto Main ;go to start of main code
;******************************************************************************
;High priority interrupt vector
; This code will start executing when a high priority interrupt occurs or
; when any interrupt occurs if interrupt priorities are not enabled.
ORG 0x0008
bra HighInt ;go to high priority interrupt routine
;******************************************************************************
;Low priority interrupt vector and routine
; This code will start executing when a low priority interrupt occurs.
; This code can be removed if low priority interrupts are not used.
ORG 0x0018
movff STATUS,STATUS_TEMP ;save STATUS register
movff WREG,WREG_TEMP ;save working register
movff BSR,BSR_TEMP ;save BSR register
; *** low priority interrupt code goes here ***
movff BSR_TEMP,BSR ;restore BSR register
movff WREG_TEMP,WREG ;restore working register
movff STATUS_TEMP,STATUS ;restore STATUS register
retfie
;******************************************************************************
;High priority interrupt routine
; The high priority interrupt code is placed here to avoid conflicting with
; the low priority interrupt vector.
HighInt:
; *** high priority interrupt code goes here ***
retfie FAST
;******************************************************************************
;Start of main program
; The main program code is placed here.
Main:
; *** main code goes here ***
;******************************************************************************
;End of program
END
Hope this get you started