| cokicoki 
 
 
 Joined: 28 Mar 2010
 Posts: 1
 
 
 
			          
 
 | 
			
				| could somebody help me to check my code... |  
				|  Posted: Sun Mar 28, 2010 6:24 am |   |  
				| 
 |  
				| i'm going to interface between GPS sensor with 16F877a.... with 38400 baudrate and 20Mhz....
 i connecting gps tx to pic rx ang gps rx to pic tx....is it enough?...
 
 this is my coding...can somebody help me out....it's appear nothing to my hyperterminal....somewhere might be wrong...but i couldn't trace it...:(
 
 
 +++++++++++++++
 Locking.
 
 Reason:  PicBasic code is Off Topic
 
 -- Forum Moderator
 +++++++++++++++
 
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 code:
 DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
 DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
 DEFINE HSER_SPBRG 77 ' 38400 Baud @ 0.16%
 define HSER_BAUD 38400
 DEFINE HSER_CLROERR 1 ' Clear overflow automatically
 
 define OSC 20 'define the oscillator
 
 rem variables
 hh var byte
 
 'include "modedefs.bas"  'include serial modes
 
 gpsin var portc.7 'rx
 gpsout var portc.6 'tx
 gpsdata var portb.2
 
 timeH var byte(2)     'variables define start
 timeM var byte(2)
 timeS var byte(2)
 
 latD var byte(2)
 latM var byte(2)
 latS var byte(2)
 latH var byte
 
 lonD var byte(3)
 lonM var byte(2)
 lonS var byte(2)
 lonH var byte
 sats VAR BYTE(2)
 sats2 VAR BYTE(2)
 sats3 VAR BYTE(2)
 sats4 VAR BYTE(2)
 sats5 VAR BYTE(2)
 sats6 VAR BYTE(2)
 sats7 VAR BYTE(2)
 sats8 VAR BYTE(2)
 sats9 VAR BYTE(2)
 sats10 VAR BYTE(2)
 sats11 VAR BYTE(2)
 sats12 VAR BYTE(2)
 Diameter var byte(2)
 Meg var byte(2)
 Mode var byte(2)
 
 
 spdI var byte
 spdD var byte(2)
 
 head var byte(3)
 
 mon var byte(2)
 day var byte(2)
 yr var byte(2)
 
 stat var byte
 G var byte
 D var byte
 M var byte
 A var byte
 F var byte
 GPGGA_IN var word
 
 
 TEMPWORD var word
 DEBOUNCE var byte
 CMDACK var byte          'variable define end
 
 start:
 hserout ["GPS data:"]
 
 gps:
 
 
 SERIN2 portB.2,188,2000,Nogps,[WAIT("$"),str sats\1, STR sats2\1, STR sats3\1, STR sats4\1,_
 str sats5\1, str sats6\1,str sats7\1, str sats8\1,_
 str sats9\1, str sats10\1, str sats11\1, str sats12\1,_
 skip 5, str dia\2, str mes\2, skip 26, str ano\2 ]
 
 hserout [sats, sats2,sats3,sats4, sats5, sats6, sats7, sats8, sats9, sats10,sats11, sats12, diameter, Meg, Mode]
 
 goto gps
 
 Nogps:
 hserout ["No GPS data"]
 pause 2000
 
 goto start
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 it's not working in my hyperterminal..help me please.....
 
 
 
  |  |