Symbol not previously defined (Send)

Discussion in 'Embedded Systems and Microcontrollers' started by twister, Apr 19, 2009.

  1. twister

    twister Thread Starter Member

    Joined:
    Mar 31, 2009
    Messages:
    15
    Hi to all the prof. here...
    I am adding a serial send routine to my existing code in PIC assembly.
    I am using PIC 16F88 with MPLAB version 8.10.00.00


    However when i compile my file, i get this error:

    Code:
    Warning[207] D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1480 : Found label after column 1. (settle)
    Error[113]   D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1488 : Symbol not previously defined (Send)
    Error[113]   D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1490 : Symbol not previously defined (Send)
    The post below is the file I am implementing. Red highlighted part is the one i added for send serial routine. Thanks. I wonder what silly mistakes i had done.
  2. twister

    twister Thread Starter Member

    Joined:
    Mar 31, 2009
    Messages:
    15
    Code:
    
    store_Ah:
        mov16    dd+2,AmpHours
    call     Serial_sent
    
    Serial_sent:
       banksel      SPBRG
       movlw      .25                  ; 9.6kbps
       movwf      SPBRG
       movlw      b'00100100'      ; brgh = high (2)
       movwf      TXSTA            ; enable Async Transmission, set brgh
    
       ; Provide a settling time for startup
       banksel      tmp1
       clrf       tmp1
       settle
       decfsz       tmp1, f
       goto       settle
    
    
       ; Send a character through the UART
    loop
       movf AmpHours, w
       call Send   ;error here
       movf AmpHours+1, w
       call Send   ;error here
       goto      $
    
    ;----------------------
    ; SEND function
    ;----------------------
    send
       banksel      TXREG
       movwf       TXREG            ; Send data which has been stored in W
    
    trans_wt
       banksel      TXSTA
       btfss       TXSTA, TRMT         ; Loop until data is sent
       goto      trans_wt      
       return
  3. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    Messages:
    22,043
    Location:
    In the vast midwest of the USA; CST
    In the 3rd line of the code you posted, you have "call" starting in column 1. Move it over past column 2.


    Right after that, you're letting the program crash into a called subroutine.

    The called subroutine does not have a return statement; instead it has a GOTO that exits the routine.
    Subroutines should have only one entrance and only one RETURN to exit.

    Why is "settle" all by itself in the middle of the code? Is that supposed to be a label?

    You are not being consistent with your use of colons. Labels should have colons.
Similar Threads: Symbol previously
Forum Title Date
Embedded Systems and Microcontrollers Symbol not previously defined (B’00000000’) error in my first program... Oct 24, 2010
Embedded Systems and Microcontrollers symbol "u687" defined more than once Feb 13, 2009
Embedded Systems and Microcontrollers Error [1105] symbol 'ADC_16ANA' has not been defined Jun 12, 2008

Share This Page