converting problem

Status
Not open for further replies.
after i download pdf file that eric give to me in using ADC input of PIC12F629
i starting to converting the code using mplab
but after pressing quickbuild button , the build always failed
error
Code:
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\BSC.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Tue Aug 10 23:33:12 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F629 "BSC.ASM" /l"BSC.lst" /e"BSC.err"
Warning[207] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 1 : Found label after column 1. (listp)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 3 : Found directive in column 1. (errorlevel)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 4 : Found directive in column 1. (radix)
Warning[207] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 5 : Found label after column 1. (__CONFIG_MCLRE_OFF)
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 5 : Illegal character (&)
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 6 : Illegal character (&)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 8 : Found directive in column 1. (UDATA_SHR)
Error[149]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 8 : Directive only allowed when generating an object file
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 9 : Illegal character (1)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 12 : Found directive in column 1. (banksel)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 12 : Executable code and data must be defined in an appropriate section
Warning[203] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 14 : Found opcode in column 1. (movlw)
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 14 : Symbol not previously defined (nLED)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 14 : Executable code and data must be defined in an appropriate section
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 15 : Found directive in column 1. (banksel)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 15 : Executable code and data must be defined in an appropriate section
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 17 : Illegal character (<)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 18 : Found directive in column 1. (banksel)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 18 : Executable code and data must be defined in an appropriate section
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 22 : Found directive in column 1. (banksel)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 22 : Executable code and data must be defined in an appropriate section
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 23 : Illegal character (,)
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 24 : Illegal character (,)
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 25 : Illegal character (,)
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 26 : Found directive in column 1. (banksel)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 26 : Executable code and data must be defined in an appropriate section
Warning[205] C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 29 : Found directive in column 1. (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\BSC.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Tue Aug 10 23:33:13 2010
----------------------------------------------------------------------
BUILD FAILED
please tell me how to fix it
 
Last edited:
hi TT,
Place this line of text near the CONFIG in your program, they suppress WARNING messages [ not ERROR] msgs.
Post you program listing, ALL of it and I will help clean it up...

errorlevel -302, -207
 
hi eric
its hard to copy , paste the code from PDF file
so i will post the code here to check if there a line error
Code:
    listp=12F629
    #include <p12F629.inc>
errorlevel -302, -207
radix      	dec
    __CONFIG_MCLRE_OFF & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF &
_PWRTE_ON & _INTRC_OSC_NOCLKOUT
constantnLED=5
UDATA_SHR
sGPIOres 1
RESETCODE0x0000
call0x03FF
banksel OSCCAL
movwfOSCCAL
movlw~(1<<nLED)
banksel TRISIO
movwfTRISIO
movlw0<<CINV|b'010'
banksel CMCON
movwfCMCON
mainloop
clrfsGPIO
banksel CMCON
btfscCMCON,COUT
bsfsGPIO,nLED
movfsGPIO,w
banksel GPIO
movwfGPIO
gotomainloop
END
i dont know how to space the code
 
Last edited:
PIC assembler is dependent on spacing - your posted program has all the parts in the wrong places, hence the error messages you get. You can either TAB or use spaces to correct it.
 
hi TT,
Do you have a printer/scanner with OCR [character recognition] software on your PC.??

If yes, print the page of interest from the pdf, scan it and then feed it thru the OCR program, correct any errors manually.

If not, its a case of copy typing.

EDIT;
which page/s of the pdf are you using.???
 
Last edited:
is this already correct one
Code:
listp=12F629
    #include <p12F629.inc>
errorlevel -302, -207
radix      	dec
    __CONFIG_MCLRE_OFF & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF &
_PWRTE_ON & _INTRC_OSC_NOCLKOUT
constantnLED=5
UDATA_SHR
sGPIOres 1
RESETCODE0x0000
call0x03FF
banksel OSCCAL
movwf OSCCAL
movlw~(1<<nLED)
banksel TRISIO
movwf TRISIO
movlw0<<CINV|b'010'
banksel CMCON
movwf CMCON
mainloop
clrfs GPIO
banksel CMCON
btfsc CMCON,COUT
bsfs GPIO,nLED
movfs GPIO,w
banksel GPIO
movwf GPIO
goto mainloop
END
 
hi TT
Part tidied, you do the rest and repost use the CODE '#' tags

Code:
listp=12F629 
    #include <p12F629.inc>
    errorlevel -302, -207
    radix    dec
    __CONFIG_MCLRE_OFF & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF &
_PWRTE_ON &    _INTRC_OSC_NOCLKOUT
constantnLED=5 
    udata_shr 
sGPIOres 1

RESETCODE0x0000  
    call0x03FF 
    banksel    OSCCAL
    movwf    OSCCAL
    movlw~(1<<nLED)  
    banksel    TRISIO
    movwf    TRISIO
    movlw0<<CINV|b'010'  
    banksel    CMCON
    movwf    CMCON
mainloop 
    clrfs    GPIO
    banksel    CMCON
    btfsc    CMCON,COUT
    bsfs    GPIO,nLED 
    movfs    GPIO,w
    banksel    GPIO
    movwf    GPIO
    goto    mainloop
    end
 
Last edited:
i dont even know what OCR is
i using PDF to word converter that online i search in google
but the word in the file is textboxted
so i copy it line by line without any space (while copy paste they did not automaticly spacing )
 
Last edited:
hi,
This code now assembles, all you need to do is to make it work...

Code:
    list p=12F629 
    #include <p12F629.inc>
    errorlevel -302, -207
    radix    dec

    __CONFIG _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT

    constant nLED=5 


    org 0x0000  

    call0x03FF 
    banksel    OSCCAL
    movwf    OSCCAL
    movlw~(1<<nLED)  
    banksel    TRISIO
    movwf    TRISIO
    movlw 0<<CINV|b'010'  
    banksel    CMCON
    movwf    CMCON
mainloop 
    clrf    GPIO
    banksel    CMCON
    btfsc    CMCON,COUT
    bsf    GPIO,nLED 
    movf     GPIO,w
    banksel    GPIO
    movwf    GPIO
    goto    mainloop
    end
 
i fix some error and theres some left
Code:
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\BSC.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Wed Aug 11 00:24:12 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F629 "BSC.ASM" /l"BSC.lst" /e"BSC.err"
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 7 : Illegal character (&)
Error[108]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 8 : Illegal character (&)
Error[149]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 11 : Directive only allowed when generating an object file
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 15 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 16 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 17 : Executable code and data must be defined in an appropriate section
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 18 : Symbol not previously defined (nLED)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 18 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 19 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 20 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 21 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 22 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 23 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 25 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 26 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 27 : Executable code and data must be defined in an appropriate section
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 28 : Symbol not previously defined (nLED)
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 28 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 29 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 30 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 31 : Executable code and data must be defined in an appropriate section
Error[152]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\BSC.ASM 32 : Executable code and data must be defined in an appropriate section
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\BSC.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Wed Aug 11 00:24:13 2010
----------------------------------------------------------------------
BUILD FAILED
Q1 : what does " Illegal character (&) " mean ?
Q2 : what does " Executable code and data must be defined in an appropriate section " mean ?
Q3 : what does " Directive only allowed when generating an object file " mean ?
Q4 : what does " Symbol not previously defined (nLED) " mean ?
 
Last edited:
hi TT,
I have now edited the program it now works.
Look at the avi file in this zip.

Code:
    list p=12F629 
    #include <p12F629.inc>
    errorlevel -302, -207
    radix    dec

    __CONFIG _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT

    constant nLED=5 

 
    call0x03FF 
    banksel    OSCCAL
    movwf    OSCCAL

    movlw    ~(1<<nLED)  
    banksel    TRISIO
    movwf    TRISIO
    movlw     0<<CINV|b'010'  
    banksel    CMCON
    movwf    CMCON

mainloop 
    clrf    GPIO
    banksel    CMCON
    btfsc    CMCON,COUT
    bsf    GPIO,nLED 
    movf     GPIO,w

    banksel    GPIO
    movwf    GPIO
    goto    mainloop

    end
 

Attachments

  • tt1.zip
    600.8 KB · Views: 119
Last edited:
hi eric
many thanks , you make the code can be converted
and also i see the video , good simulation
i never simulating anything before
 
Last edited:
hi
i got this error on other script
Code:
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\LDR1.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Wed Aug 11 03:18:24 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F629 "LDR1.asm" /l"LDR1.lst" /e"LDR1.err"
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\LDR1.ASM 25 : Symbol not previously defined (sGPIO)
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\LDR1.ASM 28 : Symbol not previously defined (sGPIO)
Error[113]   C:\DOCUMENTS AND SETTINGS\MIMI\DESKTOP\ASM AND C FILE\LDR1.ASM 30 : Symbol not previously defined (sGPIO)
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Mimi\Desktop\Asm and C file\LDR1.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.33, mplink.exe v4.33
Wed Aug 11 03:18:25 2010
----------------------------------------------------------------------
BUILD FAILED
can anyone tell me how to fix it ?
 
here is the code
Code:
    list        p=12F629  
    #include    <p12F629.inc> 
    errorlevel  -302, -207 
    radix       dec 
 
    __CONFIG _MCLRE_ON & _CP_OFF & _CPD_OFF & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
 
    constant    nLED=5          
 
        call    0x03FF              
        banksel OSCCAL              
        movwf   OSCCAL 
 
        movlw   ~(1<<nLED)         
        banksel TRISIO          
        movwf   TRISIO 
        movlw   b'110'|1<<CIS|0<<CINV 
        banksel CMCON               
        movwf   CMCON            
        movlw   1<<VRR|.7|1<<VREN 
        banksel VRCON              
        movwf   VRCON 
  
mainloop 
        clrf    sGPIO          
        banksel CMCON         
        btfsc   CMCON,COUT      
        bsf     sGPIO,nLED      
         
        movf    sGPIO,w        
        banksel GPIO   
        movwf   GPIO            
        goto    mainloop 
 
        END
 
hi TT,
Why didnt you copy and paste the program I have posted in post #11.???
It works.
yes i did , and it work
now im working in other project
i may post the video but my video editor is not responding for now
and thanks for the editing
the hex file should look like this, right ?
Code:
:020000040000FA
:1000000083169000DF30831685000230831299003A
:1000100085018312191B851605088312850008289F
:02400E00843FED
:00000001FF
edit : i have found an pdf to txt converter
so now its not too hard to copying the code
 
Last edited:

Ok,
I you need your latest code checking please post it.

That hex file looks OK.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…