Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Error During Build-- Help needed. PIC.

Status
Not open for further replies.

Ayne

New Member
My code
Code:
;***************************************************************************************************
		Processor	16F877A
		include		<P16F877A.INC>

		__config	_HS_OSC	& _WDT_OFF & _PWRTE_ON

;***************************************************************************************************

		; VARIABLE STORAGE

		cblock		0x20				;Start of gernal purpose Register


		BSF		STATUS,		RP0			;Select Bank 1
		BCF		STATUS,		RP1
		MOVLW	B'00000000'				;Set PortB All output
		MOVWF	TRISB
		BCF		STATUS,		RP0			;Select Bank 0

;**************************************************************************************************

		; PROGRAM CODE
START
		MOVLW	B'10101010'
		MOVWF	PORTB
		NOP
		MOVLW	B'01010101'
		MOVWF	PORTB
		NOP

End

These errors
Code:
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F877A "Led.asm" /l"Led.lst" /e"Led.err" /o"Led.o"
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 14 : Illegal label (BSF             STATUS)
Error[115]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 14 : Duplicate label ("RP0" or redefining symbol that cannot be redefined)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 15 : Illegal label (BCF             STATUS)
Error[115]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 15 : Duplicate label ("RP1" or redefining symbol that cannot be redefined)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 16 : Illegal label (MOVLW   B'00000000')
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 17 : Illegal label (MOVWF   TRISB)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 18 : Illegal label (BCF             STATUS)
Error[115]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 18 : Duplicate label ("RP0" or redefining symbol that cannot be redefined)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 24 : Illegal label (MOVLW   B'10101010')
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 25 : Illegal label (MOVWF   PORTB)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 26 : Illegal label (NOP)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 27 : Illegal label (MOVLW   B'01010101')
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 28 : Illegal label (MOVWF   PORTB)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 29 : Illegal label (NOP)
Error[121]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 31 : Illegal label (End)
Error[129]   E:\PROJECTS\PIC\LED FLASHING\LED.ASM 32 : Expected (END)
Halting build on first failure as requested.
BUILD FAILED: Fri Dec 22 23:59:52 2006

I am new to PIC programming in assembly
i am learning from Nigel Goodwin's tutorials but i have PIC 16F877A
I have some questions
Q NO:1- Why these errors???

Q NO:2- It is necessary to add "P16F877A.INC" file in ur "***.mcp" window under the header button???

Q NO:3- It is necessary to add "16f877a.lkr" file in ur "***.mcp" window under the linker scripts button??

Q NO:4- Is the both files("P16F877A.INC"..."16f877a.lkr") should be in our working directory???
Thanks
 

Attachments

  • obaba.GIF
    obaba.GIF
    9.3 KB · Views: 164
Last edited:
add an endc command after cblock also indent the last END statement.
You also don't need the (Q3) Linker Script or (Q2) Include file in the screenshot, you alread have them defined in the program.
Code:
; VARIABLE STORAGE

        cblock        0x20                ;Start of gernal purpose Register
        endc
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top