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.

watch window

Status
Not open for further replies.

sahanaashwin

New Member
hi
i am new in pic programming,i wrote one small addition program ,and successfuly builded.I want to add the file register called 'A1'to my watch
window. But the 'Add Symbol' feature is greyed out.
pls help me

in this program first i didnt write 'org 0x05 and goto start'.code.
with org 0x00 when compile my code i keep getting the following error code
MPLINK 4.16, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016
Errors : 1

after adding the org 0x05 code,build succeeded why?

this is the program

;add 0x58& 0xA4,display the result in PORTB
;File name add3.asm
;PICSTART plus

processor 16f84
#include <p16f84.inc>

__config _XT_OSC & _WDT_OFF & _PWRTE_ON

A1 equ 0X20

org 0x00
GOTO start

org 0x05
clrw
clrf A1
clrf STATUS
start movlw 0x00
tris PORTB
movlw 0xA4
MOVWF A1
movlw 0x58
ADDWF A1,0
MOVWF PORTB
fin: GOTO fin
end
 
Last edited:
hi,
Used the PommieTidy with your program.

Code:
;add 0x58& 0xA4,display the result in PORTB  
;File name add3.asm 
;PICSTART plus

		processor 16f84
#include	<p16f84.inc> 

		__config _XT_OSC & _WDT_OFF & _PWRTE_ON

A1		equ	0X20

		org	0x00
		GOTO	start

		org	0x04
                          retfie
start:
		clrw
		clrf	A1
		clrf	STATUS
		movlw	0x00
                          tris	PORTB
		movlw	0xA4
		MOVWF	A1
		movlw	0x58
		ADDWF	A1,0
		MOVWF	PORTB
fin:		GOTO	fin
		end
 
Last edited:
You need to build your project first. Click "Project" and then "Build All" from the MPLAB menu.
Or, if you are using the Quick build option, put the asm file in focus and click "Project" and then "QuickBuild add3.asm"
 
i build, set poject, the programming is working,but I am only using the MPLAB IDE environment to debug and flash,the add symbol is greyed out
 
Post the text from the Output window when you build the project. You should have this:
Code:
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F84 "add3.asm" /l"add3.lst" /e"add3.err"
Warning[224] C:\MPLAB\TEMP\ADD3.ASM 22 : Use of this instruction is not recommended.
Loaded C:\MPLAB\temp\add3.COD.
BUILD SUCCEEDED: Mon Jul 21 19:21:45 2008
The Warning[224] comes from the tris instruction as it is obsolete but still supported. You should have no other warnings.
 
You need to build your project first. Click "Project" and then "Build All" from the MPLAB menu.
Or, if you are using the Quick build option, put the asm file in focus and click "Project" and then "QuickBuild add3.asm"
i build, set poject, the programming is working,but I am only using the MPLAB IDE environment to debug and flash,the add symbol is greyed out
 
build

----------------------------------------------------------------------
Debug build of project `C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 22 10:36:39 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.o".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.lst".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.cof".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.hex".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16C73B "add4.asm" /l"add4.lst" /e"add4.err" /o"add4.o" /d__DEBUG=1
Warning[207] C:\USERS\IBM\DESKTOP\BHARATHI\PIC PRO\ADD4.ASM 11 : Found label after column 1. (A1)
Warning[224] C:\USERS\IBM\DESKTOP\BHARATHI\PIC PRO\ADD4.ASM 24 : Use of this instruction is not recommended.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" "..\..\..\..\..\Program Files\Microchip\MPASM Suite\LKR\16c73b.lkr" "add4.o" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"add4.cof" /M"add4.map" /W
MPLINK 4.16, Linker
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

MP2HEX 4.16, COFF to HEX File Converter
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

Loaded C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.cof.
----------------------------------------------------------------------
Debug build of project `C:\Users\IBM\Desktop\Bharathi\PIC PRO\add4.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 22 10:36:40 2008
----------------------------------------------------------------------
BUILD SUCCEEDED
 
Last edited:
Code:
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /[COLOR="Red"]p16C73B[/COLOR] "add4.asm" /l"add4.lst" /e"add4.err" /o"add4.o" /d__DEBUG=1
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" "..\..\..\..\..\Program Files\Microchip\MPASM Suite\LKR\[COLOR="Red"]16c73b.lkr[/COLOR]" "add4.o" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"add4.cof" /M"add4.map" /W
You have the wrong processor selected! Click "Configure" and then click "Select Device". Choose the "PIC16F84" from the drop down list and click "OK". Then rebuild your project. This may or may not fix your problem.
You are compiling with Debug code enabled. Which debugger are you using with MPLAB?
 
Last edited:
actually i tried with other processor and wrongly post that output to you sorry,

this is the output with processor p16f84, 2 warning,build succeeded,but add symbol is not working

Debug build of project `C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 22 11:42:32 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.o".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.lst".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.cof".
Clean: Deleted file "C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.hex".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F84 "add3.asm" /l"add3.lst" /e"add3.err" /o"add3.o" /d__DEBUG=1
Warning[207] C:\USERS\IBM\DESKTOP\BHARATHI\PIC PRO\ADD3.ASM 11 : Found label after column 1. (A1)
Warning[224] C:\USERS\IBM\DESKTOP\BHARATHI\PIC PRO\ADD3.ASM 22 : Use of this instruction is not recommended.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" "..\..\..\..\..\Program Files\Microchip\MPASM Suite\LKR\16f84.lkr" "add3.o" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"add3.cof" /M"add3.map" /W
MPLINK 4.16, Linker
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

MP2HEX 4.16, COFF to HEX File Converter
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

Loaded C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.cof.
----------------------------------------------------------------------
Debug build of project `C:\Users\IBM\Desktop\Bharathi\PIC PRO\add3.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 22 11:42:33 2008
----------------------------------------------------------------------
BUILD SUCCEEDED
 
You have a space before the label A1 and this is what causes the warning[207].
The line,
Code:
A1		equ	0X20
must not have a space at the left hand side.

I suspect you have,
Code:
	A1	equ	0X20
and this is (maybe) what's causing your problem.

Mike.
 
I just tried to reproduce your problem and it is exactly as you state. Edit, I forgot, you can't use equ for variables with relocatable code. The variables have to be in a data section.

I found a work around. You need to delete the linker script (16f84.lkr) and force a rebuild by editing your asm file and the 'Add Symbol" feature will appear.

Mike.
 
Last edited:
The linker script is only needed for relocatable code and not really required until quite complex programs are being produced. I never use the linker with 16 series chips when working in assembler.

Mike.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top