smiles
Advanced Member level 4
Here is the code
Compile it with MPLAB, it says successful like this
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Program Files\Microchip\MyProject\16F877ATMP".
Clean: Deleted file "C:\Program Files\Microchip\MyProject\16F877ATMPO.lst".
Clean: Deleted file "C:\Program Files\Microchip\MyProject\Project.cof".
Clean Warning: File "C:\Program Files\Microchip\MyProject\Project.cod" doesn't exist.
Clean: Deleted file "C:\Program Files\Microchip\MyProject\Project.hex".
Clean Warning: File "C:\Program Files\Microchip\MyProject\Project.lst" doesn't exist.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F877A "16F877ATMPO.ASM" /l"16F877ATMPO.lst" /e"16F877ATMPO.err" /o"16F877ATMP"
Message[302] C:\PROGRAM FILES\MICROCHIP\MYPROJECT\16F877ATMPO.ASM 14 : Register in operand not in bank 0. Ensure that bank bits are correct.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPLink.exe" "C:\Program Files\Microchip\MyProject\16f877a.lkr" "C:\Program Files\Microchip\MyProject\16F877ATMP" /o"Project.cof" /M"Project.map" /W
MPLINK 4.12, Linker
Copyright (c) 2007 Microchip Technology Inc.
Errors : 0
MP2HEX 4.12, COFF to HEX File Converter
Copyright (c) 2007 Microchip Technology Inc.
Errors : 0
Loaded C:\Program Files\Microchip\MyProject\Project.cof.
BUILD SUCCEEDED: Sat Aug 04 11:17:23 2007
But when I use MPLAB SIMULATE, PORTA still 00000000 all time ?
Anyone know why ?
Thanks !!!
Code:
list p=16f877a ; list directive to define processor
#include <p16f877a.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
COUNT1 equ 08h ;First counter for our delay loops
;*******************************************************************
org 0x0000
goto Main
org 0x0005 ; processor reset vector
;****Set up the port****
Main
banksel TRISA
movlw 01h ;Set the Port A pins:
movwf TRISA ;bit 1 to output, bit 0 to input.
banksel PORTA
movlw 02h ;Set up our w register with 02h
Start1
bsf PORTA,7 ;Set bit 7
goto Start1 ;go back to Start1
END
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Program Files\Microchip\MyProject\16F877ATMP".
Clean: Deleted file "C:\Program Files\Microchip\MyProject\16F877ATMPO.lst".
Clean: Deleted file "C:\Program Files\Microchip\MyProject\Project.cof".
Clean Warning: File "C:\Program Files\Microchip\MyProject\Project.cod" doesn't exist.
Clean: Deleted file "C:\Program Files\Microchip\MyProject\Project.hex".
Clean Warning: File "C:\Program Files\Microchip\MyProject\Project.lst" doesn't exist.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F877A "16F877ATMPO.ASM" /l"16F877ATMPO.lst" /e"16F877ATMPO.err" /o"16F877ATMP"
Message[302] C:\PROGRAM FILES\MICROCHIP\MYPROJECT\16F877ATMPO.ASM 14 : Register in operand not in bank 0. Ensure that bank bits are correct.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPLink.exe" "C:\Program Files\Microchip\MyProject\16f877a.lkr" "C:\Program Files\Microchip\MyProject\16F877ATMP" /o"Project.cof" /M"Project.map" /W
MPLINK 4.12, Linker
Copyright (c) 2007 Microchip Technology Inc.
Errors : 0
MP2HEX 4.12, COFF to HEX File Converter
Copyright (c) 2007 Microchip Technology Inc.
Errors : 0
Loaded C:\Program Files\Microchip\MyProject\Project.cof.
BUILD SUCCEEDED: Sat Aug 04 11:17:23 2007
But when I use MPLAB SIMULATE, PORTA still 00000000 all time ?
Anyone know why ?
Thanks !!!