Symbol not previously defined (Send)

Thread Starter

twister

Joined Mar 31, 2009
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:

Rich (BB 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.
 

Thread Starter

twister

Joined Mar 31, 2009
15
Rich (BB 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
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 
Top