Menu

Error - ASM: compiled.asm:145:Error[113] Sy

Anobium
2013-01-25
2013-05-30
  • Anobium

    Anobium - 2013-01-25

    ASM: compiled.asm:145:Error   Symbol not previously defined (GO_DONE).
    ASM: compiled.asm:147:Error   Symbol not previously defined (GO_DONE).

    Compile error.  Is there an issue in the dat file? I just do not know what to correct.

    Thanks

    Code.

    ;Chip Settings
    #chip 16F1847,32
    #config OSC=INTOSC

    dir PORTA.0 in
    dir PORTB.0 out

    Main:
    PWMLevel = ReadAD(AN0)
    set PORTB.0 on
    for PWMCount = 1 to 255
      if PWMCount > PWMLevel then set PORTB.0 off
    next
    goto Main

     
  • ic-beau

    ic-beau - 2013-01-26

    That's odd… that kind of error happens when a label does not exist that you are trying to GOTO.  The same thing would happen if you remarked "Main:"  in your program.  Look at the .ASM file to see if you can find where "GO_DONE" is supposed to be. .. use a text editor that shows line numbers and look near line 145 and line 147 to see what's going on there or see where that block is called from.   Can you post the .ASM file?

     
  • Anobium

    Anobium - 2013-01-27
    ;Program compiled by Great Cow BASIC (0.9 5/11/2012)
    ;Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,
    ;check the documentation or email w_cholmondeley at users dot sourceforge dot net.
    ;********************************************************************************
    ;Set up the assembler options (Chip type, clock source, other bits and pieces)
     LIST p=16F1847, r=DEC
    #include <P16F1847.inc>
     __CONFIG _CONFIG1, _MCLRE_OFF & _WDTE_OFF & _FOSC_INTOSC
     __CONFIG _CONFIG2, _LVP_OFF & _PLLEN_OFF
    ;********************************************************************************
    ;Set aside memory locations for variables
    DELAYTEMP   EQU 112
    SysWaitTemp10US EQU 117
    ADREADPORT  EQU 32
    PWMCOUNT    EQU 33
    PWMLEVEL    EQU 34
    READAD  EQU 35
    ;********************************************************************************
    ;Vectors
        ORG 0
        goto    BASPROGRAMSTART
        ORG 4
        retfie
    ;********************************************************************************
    ;Start of program memory page 0
        ORG 5
    BASPROGRAMSTART
    ;Call initialisation routines
        call    INITSYS
    ;Start of the main program
        banksel TRISA
        bsf TRISA,0
        bcf TRISB,0
    MAIN
        banksel ADREADPORT
        clrf    ADREADPORT
        call    FN_READAD
        movf    READAD,W
        movwf   PWMLEVEL
        bsf PORTB,0
        clrf    PWMCOUNT
    SysForLoop1
        incf    PWMCOUNT,F
        movf    PWMCOUNT,W
        subwf   PWMLEVEL,W
        btfss   STATUS, C
        bcf PORTB,0
        movlw   255
        subwf   PWMCOUNT,W
        btfss   STATUS, C
        goto    SysForLoop1
    SysForLoopEnd1
        goto    MAIN
    BASPROGRAMEND
        sleep
        goto    BASPROGRAMEND
    ;********************************************************************************
    Delay_10US
    D10US_START
        movlw   25
        movwf   DELAYTEMP
    DelayUS0
        decfsz  DELAYTEMP,F
        goto    DelayUS0
        nop
        decfsz  SysWaitTemp10US, F
        goto    D10US_START
        return
    ;********************************************************************************
    INITSYS
        movlw   135
        banksel OSCCON
        andwf   OSCCON,F
        movlw   240
        iorwf   OSCCON,F
        bcf ADCON0,ADON
        bcf ADCON1,ADFM
        banksel ANSELA
        clrf    ANSELA
        clrf    ANSELB
        banksel CM2CON0
        bcf CM2CON0,C2ON
        bcf CM1CON0,C1ON
        banksel PORTA
        clrf    PORTA
        clrf    PORTB
        return
    ;********************************************************************************
    FN_READAD
    SysSelect1Case1
    SysSelectEnd1
        banksel ADCON1
        bcf ADCON1,ADCS1
        bsf ADCON1,ADCS0
        bcf ADCON0,CHS0
        bcf ADCON0,CHS1
        bcf ADCON0,CHS2
        bcf ADCON0,CHS3
        banksel ADREADPORT
        btfss   ADREADPORT,0
        goto    ENDIF3
        banksel ADCON0
        bsf ADCON0,CHS0
    ENDIF3
        banksel ADREADPORT
        btfss   ADREADPORT,1
        goto    ENDIF4
        banksel ADCON0
        bsf ADCON0,CHS1
    ENDIF4
        banksel ADREADPORT
        btfss   ADREADPORT,2
        goto    ENDIF5
        banksel ADCON0
        bsf ADCON0,CHS2
    ENDIF5
        banksel ADREADPORT
        btfss   ADREADPORT,3
        goto    ENDIF6
        banksel ADCON0
        bsf ADCON0,CHS3
    ENDIF6
        banksel ADCON0
        bsf ADCON0,ADON
        movlw   2
        movwf   SysWaitTemp10US
        banksel STATUS
        call    Delay_10US
        banksel ADCON0
        bsf ADCON0,GO_DONE
    SysWaitLoop1
        btfsc   ADCON0,GO_DONE
        goto    SysWaitLoop1
        bcf ADCON0,ADON
        banksel ANSELA
        clrf    ANSELA
        clrf    ANSELB
        banksel ADRESH
        movf    ADRESH,W
        banksel READAD
        movwf   READAD
        return
    ;********************************************************************************
    ;Start of program memory page 1
        ORG 2048
    ;Start of program memory page 2
        ORG 4096
    ;Start of program memory page 3
        ORG 6144
     END
    
     
  • Anobium

    Anobium - 2013-01-27

    I have changed the chip to16F1825.

    Same error.

    My test program.

    #chip 16F1825, 4
    #config Osc = XT, MCLRE_ON
    'Setup the ADC  pin direction
        Dir PORTA.0 In
        dim ADCreading as byte
        main:
                    ADCreading = ReadAD(AN0)
                    [\code]
    
     
  • kent_twt4

    kent_twt4 - 2013-01-27

    I have no problem compiling with GCB (0.9 31/5/2012).  COMPILE.BAT file contains instructions for using the internal assembler:

    @ECHO OFF
    C:
    cd \PROGRA~1\GCBASIC
    GCBASIC /NP /NC  %1 /O:compiled.asm /A:GCASM /P:download.bat
    rem /V is verbose capture output mode
    rem GCBASIC /NP /NC %1 /O:compiled.asm /A:makeasm.bat /P:download.bat
    

    I was going to guess an outdated MPLAB and MPASM for the newer enhanced midrange device files?

     
  • Anobium

    Anobium - 2013-01-27

    Superb response.   The error has now gone.

    I have changed to  the internal assembler '/A:GCASM'.

    Thank you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.