justwantin
New Member
I'm very new to programming PIC's and this list. I have been reading about programming PIC's but with so much info on the net I may have missed something.
First off, do tabs abnd carriage returns matter in an .asm file? I have noticed that different editors handle tabs and such differently, e.g. notepad will add a carriage return to the file but most linux editors do not. I have been having trouble assembling a tutorial script and have noticed changes in line and contents when opening in different editors.
Secondly I have a recently purchased PICKit 2 and have installed MPLab-8.33 from a download. Using the turn_on_led.asm from the tutorial I am getting very different results between MPLab and Pikdev a linux based ide
MPlab only gives me the option of using a linker file 12f509_g.lkr, while Pikdev users a file named 12f509.lkr. I get failed builds in MPLab but do not in Pikdev. I also get "out of date notices for my object file among others.
Could this be something attributable to older code on newer software, perhaps something else? I have gonne over the asm more than once and can't find anything different fom the Gooligum tutorial. I'll post error messages and my code below:
TIA
I have removed comments in the asm for brevity:
First off, do tabs abnd carriage returns matter in an .asm file? I have noticed that different editors handle tabs and such differently, e.g. notepad will add a carriage return to the file but most linux editors do not. I have been having trouble assembling a tutorial script and have noticed changes in line and contents when opening in different editors.
Secondly I have a recently purchased PICKit 2 and have installed MPLab-8.33 from a download. Using the turn_on_led.asm from the tutorial I am getting very different results between MPLab and Pikdev a linux based ide
MPlab only gives me the option of using a linker file 12f509_g.lkr, while Pikdev users a file named 12f509.lkr. I get failed builds in MPLab but do not in Pikdev. I also get "out of date notices for my object file among others.
Could this be something attributable to older code on newer software, perhaps something else? I have gonne over the asm more than once and can't find anything different fom the Gooligum tutorial. I'll post error messages and my code below:
TIA
Code:
Debug build of project `C:\Projects\Lesson-1\turn-on-led.mcp' started.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Preprocessor symbol `__DEBUG' is defined. Thu Aug 27 19:18:34 2009
----------------------------------------------------------------------
Make: The target "C:\Projects\Lesson-1\turn-on-led-01.o" is out of date. Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F509 "turn-on-led-01.asm" /l"turn-on-led-01.lst" /e"turn-on-led-01.err" /o"turn-on-led-01.o" /d__DEBUG=1
Make: The target "C:\Projects\Lesson-1\turn-on-led.cof" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\
mplink.exe" "..\..\Program Files\Microchip\
MPASM Suite\LKR\12f509_g.lkr" "turn-on-led-01.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"turn-on-led.cof" /M"turn-on-led.map" /W
MPLINK 4.33, Linker
Copyright (c) 2009 Microchip Technology Inc.
Error - section '.config_0FFF_TURN-ON-LED-01.O' can not fit the absolute section. Section '.config_0FFF_TURN-ON-LED-01.O' start=0x00000fff, length=0x00000002
Errors : 1 Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Projects\Lesson-1\turn-on-led.mcp' failed.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Preprocessor symbol `__DEBUG' is defined.
Thu Aug 27 19:18:36 2009
----------------------------------------------------------------------
BUILD FAILED
I have removed comments in the asm for brevity:
Code:
list p=12F509 ; list directive to define processor
#include <p12F509.inc> ; processor specific variable definitions
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC
;**********************************************************************
RESET CODE 0x3FF ; processor reset vector
res 1 ; holds movlw with factory RC cal value
MAIN CODE 0x000 ; effective reset vector
movwf OSCCAL ; update OSCAL (register) with factory cal value
;***** Initialisation
start
movlw b'111101' ; configure GP1 (only) as an output
tris GPIO
movlw b'000010' ; set GP1 high
movwf GPIO
goto $
END