Autor Tema: Modulo GPS U-NEO-6-MV Proton  (Leído 2282 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado Noelillo

  • PIC12
  • **
  • Mensajes: 94
Modulo GPS U-NEO-6-MV Proton
« en: 02 de Diciembre de 2013, 06:40:39 »
Tengo un modulo GPS y no consigo que funcione.

Este es el programa que encontré en internete.

Código: [Seleccionar]
'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 27/01/2008                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
Device 18F452
XTAL = 10
Dim LATG[2] As Byte
Dim LATM[2] As Byte
Dim LATS[5] As Byte
Dim LONG[3] As Byte
Dim LONM[2] As Byte
Dim LONS[5] As Byte
Dim War[2] As Byte
Dim KNOTS[8] As Byte
Dim MINFRAC[4] As Byte
Dim MIWFRAC[4] As Byte
Dim SEGn As Byte
Dim SEGw As Byte
Dim i As Byte
   
TRISB = %00000000
HSERIAL_BAUD = 9600        ' Set baud rate to 9600
HSERIAL_RCSTA = %10010000  ' Enable serial port and continuous receive
HSERIAL_TXSTA = %00100000  ' Enable transmit and asynchronous mode
HSERIAL_CLEAR = On         ' Optionally clear the

LAP:
HSerIn 5000,caer,[ Wait("$GPRMC"), skip 12, Str War\2, Str LATG\2, Str LATM\2, skip 1, Str MINFRAC\4, skip 3, Str LONG\3,_
Str LONM\2, skip 1, Str MIWFRAC\4, skip 3, Str KNOTS\8]

If War[0]= "A" Then
  GoSub guardar
EndIf
GoSub recuperar
GoSub imprime
GoTo LAP

guardar:
For i = 0 To 1
EWrite i, [LATG[i]]
EWrite i+2, [LATM[i]]
EWrite i+4, [LONG[i]]
EWrite i+6, [LONM[i]]
Next
For i = 0 To 3
EWrite i+8, [MINFRAC[i]]
EWrite i+12, [MIWFRAC[i]]
Next
Return

recuperar:
For i = 0 To 1
LATG[i] = ERead i
LATM[i] = ERead i+2
LONG[i] = ERead i+4
LONM[i] = ERead i+6
Next
For i = 0 To 3
MINFRAC[i]=ERead i+8
MIWFRAC[i]=ERead i+12
Next
Return

imprime:
Cls
Print At 1,1, Str LATG\2,"g ",Str LATM\2,".",Str MINFRAC\4,"m_N"
Print At 2,1, Str LONG\3,"g ",Str LONM\2,".",Str MIWFRAC\4,"m_W"
DelayMS 1500
Cls
Print At 1,1, Str War, " estado", Str KNOTS
DelayMS 1500
Cls
Return
caer:
GoSub recuperar
GoSub imprime_ul
GoTo LAP
imprime_ul:
Cls
Print At 1,1, Str LATG\2,"g ",Str LATM\2,".",Str MINFRAC\4,"m_N"
Print At 2,1, Str LONG\3,"g ",Str LONM\2,".",Str MIWFRAC\4,"m_W"
DelayMS 1500
Cls
Print At 1,1, "Ultimo valor"
DelayMS 1500
Cls
Return

End







No se, si este es el programa correcto para este modulo.


Desconectado Noelillo

  • PIC12
  • **
  • Mensajes: 94
Re: Modulo GPS U-NEO-6-MV Proton
« Respuesta #1 en: 02 de Diciembre de 2013, 09:35:01 »
El pic que utilizo es el 16F887A a 20Mhz.
DEVICE  16F887A
XTAL = 20


Desconectado Noelillo

  • PIC12
  • **
  • Mensajes: 94
Re: Modulo GPS U-NEO-6-MV Proton
« Respuesta #2 en: 09 de Diciembre de 2013, 17:41:11 »
Código: [Seleccionar]
'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 03/12/2013                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************
'Device 18F452
Device 16F877A
XTAL = 20
' LCD pin Configuracion
        LCD_TYPE = 0
        LCD_LINES = 4
        LCD_DTPIN = PORTB.4
        LCD_RSPIN = PORTB.2
        LCD_ENPIN = PORTB.3
        LCD_INTERFACE = 4
        ALL_DIGITAL = On
        Dim HORA[2] As Byte
Dim MINUTOS[2] As Byte
Dim SEGUNDOS[2] As Byte
Dim SEGUNDILLOS[2] As Byte
Dim COURSEA[2] As Byte
Dim COURSEB[2] As Byte
Dim DIA[2] As Byte
Dim MES[2] As Byte
Dim ANO[2] As Byte
Dim LATG[2] As Byte
Dim LATM[2] As Byte
Dim LATS[5] As Byte
Dim LONG[3] As Byte
Dim LONM[2] As Byte
Dim LONS[5] As Byte
Dim War[2] As Byte
Dim KNOTS[1] As Byte
Dim MINFRAC[4] As Byte
Dim MIWFRAC[4] As Byte
Dim SEGn As Byte
Dim SEGw As Byte
Dim i As Byte
   
TRISB = %00000000
HSERIAL_BAUD = 9600        ' Set baud rate to 9600
HSERIAL_RCSTA = %10010000  ' Enable serial port and continuous receive
HSERIAL_TXSTA = %00100000  ' Enable transmit and asynchronous mode
HSERIAL_CLEAR = On         ' Optionally clear the

Cls
Print At 1,1,"Modulo GPS"
Print At 2,1,"--- 2013 ---"
DelayMS 1000
Cls

LAP:
HSerIn 5000,caer,[ Wait("$GPRMC"),skip 1,Str HORA\2,Str MINUTOS\2,Str SEGUNDOS\2,skip 1,Str SEGUNDILLOS\2,skip 1,_
Str War\2,_
Str LATG\2, Str LATM\2, skip 1, Str MINFRAC\4, skip 4, Str LONG\3,_
Str LONM\2, skip 1, Str MIWFRAC\4, skip 3, Str KNOTS\2, skip 1,_
Str COURSEA\2, skip 1, Str COURSEB\2, Str DIA\2,Str MES\2,Str ANO\2]
                                                                        ', skip 1,
'HSerIn 5000,caer,[ Wait("$GPRMC"), skip 11, Str War\2, Str LATG\2, Str LATM\2, skip 1, Str MINFRAC\4, skip 3, Str LONG\3,_
'Str LONM\2, skip 1, Str MIWFRAC\4, skip 3, Str KNOTS\8]

'SERIN PORTc.6 , 24660 ,caer,[ Wait("$GPRMC"), skip 12, Str War\2, Str LATG\2, Str LATM\2, skip 1, Str MINFRAC\4, skip 3, Str LONG\3,_
'Str LONM\2, skip 1, Str MIWFRAC\4, skip 3, Str KNOTS\8]
 GoSub TIMER
' GoTo LAP
 GoSub imprime
If War[0] ="V" Then
Cls
Print At 1,1,"Nav.Rec.Warning"
DelayMS 1000
EndIf
If War[0]= "A" Then '"A"
  GoSub guardar
EndIf
GoSub recuperar
GoSub imprime
GoTo LAP

guardar:
Cls
Print At 1,1,"GUARDA DATOS"
DelayMS 1500
Cls
For i = 0 To 1
EWrite i, [LATG[i]]
EWrite i+2, [LATM[i]]
EWrite i+4, [LONG[i]]
EWrite i+6, [LONM[i]]
Next
For i = 0 To 3
EWrite i+8, [MINFRAC[i]]
EWrite i+12, [MIWFRAC[i]]
Next
Return

recuperar:
Cls
Print At 1,1,"LEE DATOS"
DelayMS 1500
Cls
For i = 0 To 1
LATG[i] = ERead i
LATM[i] = ERead i+2
LONG[i] = ERead i+4
LONM[i] = ERead i+6
Next
For i = 0 To 3
MINFRAC[i]=ERead i+8
MIWFRAC[i]=ERead i+12
Next
Return

imprime:
Cls
Print At 1,1," ", Str LATG\2,"g ",Str LATM\2,".",Str MINFRAC\4,"m_N"
Print At 2,1, Str LONG\3,"g ",Str LONM\2,".",Str MIWFRAC\4,"m_W"
DelayMS 1500
'stop
Cls
Print At 1,1, Str War, " estado", Str KNOTS
DelayMS 1500
Cls
Return
caer:
GoSub recuperar
GoSub imprime_ul
GoTo LAP
imprime_ul:
Cls
Print At 1,1, Str LATG\2,"g ",Str LATM\2,".",Str MINFRAC\4,"m_N"
Print At 2,1, Str LONG\3,"g ",Str LONM\2,".",Str MIWFRAC\4,"m_W"
DelayMS 1500
Cls
Print At 1,1, "Ultimo valor"
DelayMS 1500
Cls
Return

TIMER:
Print At 1,5,"TIMER GPS"
DelayMS 1000
CLS
Print At 1,3,Str DIA\2,"-",Str MES\2,"-20",Str ANO\2
Print At 2,3,Str HORA\2,":",Str MINUTOS\2,":",Str SEGUNDOS\2,",",Str SEGUNDILLOS\2
DelayMS 1000
Cls
Return
CURSO:
Print At 1,1,"CURSO"
End


Ya esta!!!! :-/