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
    15
    0
    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 ( (Unknown Language)):
    1. Warning[207] D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1480 : Found label after column 1. (settle)
    2. [B][COLOR=Red]Error[113]   D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1488 : Symbol not previously defined (Send)
    3. Error[113]   D:\WATT METER (DESIRED DESIGN)\WATTMETER.ASM 1490 : Symbol not previously defined (Send)[/COLOR][/B]
    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.
     
    #1
  2. twister

    twister Thread Starter Member

    Joined:
    Mar 31, 2009
    15
    0
    Code ( (Unknown Language)):
    1.  
    2.  
    3. store_Ah:
    4.     mov16    dd+2,AmpHours
    5. [B][COLOR=Red]call     Serial_sent[/COLOR][/B]
    6.  
    7. Serial_sent:
    8.    banksel      SPBRG
    9.    movlw      .25                  ; 9.6kbps
    10.    movwf      SPBRG
    11.    movlw      b'00100100'      ; brgh = high (2)
    12.    movwf      TXSTA            ; enable Async Transmission, set brgh
    13.  
    14.    ; Provide a settling time for startup
    15.    banksel      tmp1
    16.    clrf       tmp1
    17.    settle
    18.    decfsz       tmp1, f
    19.    goto       settle
    20.  
    21.  
    22.    ; Send a character through the UART
    23. loop
    24.    movf AmpHours, w
    25.    [B][COLOR=Red]call Send[/COLOR][/B]   ;error here
    26.    movf AmpHours+1, w
    27.    [COLOR=Red][B]call Send[/B][/COLOR]   ;error here
    28.    goto      $
    29.  
    30. ;----------------------
    31. ; SEND function
    32. ;----------------------
    33. send
    34.    banksel      TXREG
    35.    movwf       TXREG            ; Send data which has been stored in W
    36.  
    37. trans_wt
    38.    banksel      TXSTA
    39.    btfss       TXSTA, TRMT         ; Loop until data is sent
    40.    goto      trans_wt      
    41.    return
     
    #2
  3. SgtWookie

    SgtWookie Expert

    Joined:
    Jul 17, 2007
    22,163
    1,691
    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.
     
    #3
Loading...