All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-20-2009, 03:11 AM
twister twister is offline
Junior Member
 
Join Date: Apr 2009
Posts: 15
Default Symbol not previously defined (Send)

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)
Select All
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.
Reply With Quote
  #2  
Old 04-20-2009, 03:12 AM
twister twister is offline
Junior Member
 
Join Date: Apr 2009
Posts: 15
Default

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
Select All
Reply With Quote
  #3  
Old 04-20-2009, 03:43 AM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Expert Member
 
Join Date: Jul 2007
Location: In the vast midwest of the USA; CST
Posts: 22,030
Default

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.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Reply With Quote
Reply   Post New Thread

Tags
, , ,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help.........MPLAB project building riad_00 Embedded Systems and Microcontrollers 11 06-03-2009 11:05 AM
symbol "u687" defined more than once steveonline Embedded Systems and Microcontrollers 5 02-14-2009 12:23 PM
Strange electronic symbol sportsfan27 The Projects Forum 4 02-10-2009 12:09 AM
Error [1105] symbol 'ADC_16ANA' has not been defined carrie_ Embedded Systems and Microcontrollers 0 06-12-2008 11:11 AM
7seg interfacing RTC- HELP! digital Programmer's Corner 1 02-08-2008 06:08 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.