就是下面的程序
;**********************************************************
; THIS IS A GPS RECEIVER PROGRAM *
;**********************************************************
LIST P=16F874
INCLUDE P16F874.INC
;*******寄存器定义 ********************
TEMP1 EQU 0X27
W_TEMP EQU 0X54
STATUS_TEMP EQU 0X55
LONG1 EQU 0X40 ;LONG1--- LONG10经度的10位数据
LONG2 EQU 0X41
LONG3 EQU 0X42
LONG4 EQU 0X43
LONG5 EQU 0X44
LONG6 EQU 0X45
LONG7 EQU 0X46
LONG8 EQU 0X47
LONG9 EQU 0X48
LONG10 EQU 0X49
T1 EQU 0X58 ;T1---T6时间的6位数据
T2 EQU 0X59
T3 EQU 0X60
T4 EQU 0X61
T5 EQU 0X62
T6 EQU 0X63
;********************************************************
ORG 00H
NOP
NOP
GOTO MAIN
ORG 04H ;设定按中端健才开始数据接受
NOP
NOP
GOTO INTERRUPT
;*********判断头文件是不是'$GPGGA’**********
IDMESSAGE
BCF STATUS,RP0
BREAK0
CALL PAND
MOVWF TEMP1
MOVLW '$' ;detect $
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND
MOVWF TEMP1
MOVLW 'G' ;detect G
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND
MOVWF TEMP1
MOVLW 'P' ;detect P
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND
MOVWF TEMP1
MOVLW 'G' ;detect G
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND
MOVWF TEMP1
MOVLW 'G' ;detect G
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND
MOVWF TEMP1
MOVLW 'A' ;detect A
SUBWF TEMP1,0
BTFSS STATUS,Z
GOTO BREAK0
CALL PAND ;跳过逗号
RETURN
;************接收函数****************** |