Hi All
I'm just starting out with PIC programming and am working through a book called 'PIC In Practice' by D.W. Smith.
At the moment I am simply trying to get some code compiled to test out the very basics, however it would not compile. So I tried to compile just the header file, with the same results. I have not even got as far as attempting to blow the code into the PIC programmer so I believe this is simply an issue to do with the code or the IDE. The code I am trying to compile is as follows:
; HEADER84.ASM for 16F84. This sets PORTA as an INPUT
; and PORTB as an output
; The OPTION Register is set to /256 to give timing pulses of 1/32s
; 1 second and 0.5 second delays are included in the subroutine section.
; ************************
; EQUATES SECTION
TMR0 EQU 1
STATUS EQU 3
PORTA EQU 5
PORTB EQU 6
TRISA EQU 85H
TRISB EQU 86H
OPTION_R EQU 81H
ZEROBIT EQU 2
COUNT EQU 0CH
; ************************
LIST P=16F84
ORG 0
GOTO START
; ******************************
; Configuration Bits
_CONFIG H'4FF0'
; **********************
; SUBROUTINE SECTION
; 1 second delay
DELAY1 CLRF TMR0
LOOPA MOVF TMR0,W
SUBLW .32
BTFSS STATUS,
ZEROBIT
GOTO LOOPA
RETLW 0
; 0.5 second delay
DELAYP5 CLRF TMR0
LOOPB MOVF TMR0,W
SUBLW .16
BTFSS STATUS,
ZEROBIT
GOTO LOOPB
RETLW 0
; ************************
; CONFIGURATION SECTION
START BSF STATUS,5
MOVLW B'00011111'
MOVWF TRISA
MOVLW B'00000000'
MOVWF TRISB
MOVLW B'00000111'
MOVWF OPTION_R
BCF STATUS,5
CLRF PORTA
CLRF PORTB
; **************************
; Program starts now
END
(I have removed the comments and tried to format for easy reading, otherwise this is a direct copy/paste.)
The error message is as follows. All advice gratefully received!
----------------------------------------------------------------------
Debug build of project `C:\1diot stick and electronic misc\Duncsoft\HEADER84.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 26 18:20:43 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\1diot stick and electronic misc\MicroChip\MPASM Suite\MPASMWIN.exe" /q /p16F84 "HEADER84.ASM" /l"HEADER84.lst" /e"HEADER84.err" /d__DEBUG=1
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 22 : Found directive in column 1. (LIST)
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 23 : Found directive in column 1. (ORG)
Warning[203] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 24 : Found opcode in column 1. (GOTO)
Error[122] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 30 : Illegal opcode (H)
Error[128] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 42 : Missing argument(s)
Warning[207] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 43 : Found label after column 1. (ZEROBIT)
Error[115] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 43 : Duplicate label ("ZEROBIT" or redefining symbol that cannot be redefined)
Error[128] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 52 : Missing argument(s)
Warning[207] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 53 : Found label after column 1. (ZEROBIT)
Error[115] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 53 : Duplicate label ("ZEROBIT" or redefining symbol that cannot be redefined)
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 63 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 65 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 67 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 78 : Found directive in column 1. (END)
Skipping link step. Not all sources built successfully.
----------------------------------------------------------------------
Debug build of project `C:\1diot stick and electronic misc\Duncsoft\HEADER84.disposable_mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 26 18:20:44 2008
----------------------------------------------------------------------
BUILD FAILED
I'm just starting out with PIC programming and am working through a book called 'PIC In Practice' by D.W. Smith.
At the moment I am simply trying to get some code compiled to test out the very basics, however it would not compile. So I tried to compile just the header file, with the same results. I have not even got as far as attempting to blow the code into the PIC programmer so I believe this is simply an issue to do with the code or the IDE. The code I am trying to compile is as follows:
; HEADER84.ASM for 16F84. This sets PORTA as an INPUT
; and PORTB as an output
; The OPTION Register is set to /256 to give timing pulses of 1/32s
; 1 second and 0.5 second delays are included in the subroutine section.
; ************************
; EQUATES SECTION
TMR0 EQU 1
STATUS EQU 3
PORTA EQU 5
PORTB EQU 6
TRISA EQU 85H
TRISB EQU 86H
OPTION_R EQU 81H
ZEROBIT EQU 2
COUNT EQU 0CH
; ************************
LIST P=16F84
ORG 0
GOTO START
; ******************************
; Configuration Bits
_CONFIG H'4FF0'
; **********************
; SUBROUTINE SECTION
; 1 second delay
DELAY1 CLRF TMR0
LOOPA MOVF TMR0,W
SUBLW .32
BTFSS STATUS,
ZEROBIT
GOTO LOOPA
RETLW 0
; 0.5 second delay
DELAYP5 CLRF TMR0
LOOPB MOVF TMR0,W
SUBLW .16
BTFSS STATUS,
ZEROBIT
GOTO LOOPB
RETLW 0
; ************************
; CONFIGURATION SECTION
START BSF STATUS,5
MOVLW B'00011111'
MOVWF TRISA
MOVLW B'00000000'
MOVWF TRISB
MOVLW B'00000111'
MOVWF OPTION_R
BCF STATUS,5
CLRF PORTA
CLRF PORTB
; **************************
; Program starts now
END
(I have removed the comments and tried to format for easy reading, otherwise this is a direct copy/paste.)
The error message is as follows. All advice gratefully received!
----------------------------------------------------------------------
Debug build of project `C:\1diot stick and electronic misc\Duncsoft\HEADER84.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 26 18:20:43 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\1diot stick and electronic misc\MicroChip\MPASM Suite\MPASMWIN.exe" /q /p16F84 "HEADER84.ASM" /l"HEADER84.lst" /e"HEADER84.err" /d__DEBUG=1
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 22 : Found directive in column 1. (LIST)
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 23 : Found directive in column 1. (ORG)
Warning[203] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 24 : Found opcode in column 1. (GOTO)
Error[122] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 30 : Illegal opcode (H)
Error[128] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 42 : Missing argument(s)
Warning[207] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 43 : Found label after column 1. (ZEROBIT)
Error[115] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 43 : Duplicate label ("ZEROBIT" or redefining symbol that cannot be redefined)
Error[128] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 52 : Missing argument(s)
Warning[207] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 53 : Found label after column 1. (ZEROBIT)
Error[115] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 53 : Duplicate label ("ZEROBIT" or redefining symbol that cannot be redefined)
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 63 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 65 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 67 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[205] C:\1DIOT STICK AND ELECTRONIC MISC\DUNCSOFT\HEADER84.ASM 78 : Found directive in column 1. (END)
Skipping link step. Not all sources built successfully.
----------------------------------------------------------------------
Debug build of project `C:\1diot stick and electronic misc\Duncsoft\HEADER84.disposable_mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Wed Nov 26 18:20:44 2008
----------------------------------------------------------------------
BUILD FAILED
Last edited: