NMEA parse module using both USART's

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
mikayo
Registered User
Registered User
Posts: 2
Joined: Tue Oct 09, 2007 5:55 pm
Location: Toluca, Mexico

NMEA parse module using both USART's

Post by mikayo » Fri Oct 12, 2007 9:35 pm

Hello David.

I am using your NMEA parse module , but i am trying to outputing the parsed data to the USART2 , i modified the code but nothing happend , could you please help me or tell me what i am doing wrong ???

// device and clock

Device = 18F8722 // PIC18F8722
Clock = 10 // clock frequency equal to 10Mhz

Config
OSC = HSPLL // clock by 4 = 40.000 Mhz

// import modules...
Include "NMEA.bas"
Include "Usart.bas"
Include "Usart2.bas"
Include "Convert.bas"

' local variables
Dim NMEAItem As TNMEA
Dim Field As String

' program start
USART.SetBaudrate(br4800)
USART2.SetBaudrate(br4800)
While True
If NMEA.GetItem(NMEAItem) And NMEAItem.Valid Then
NMEA.GetField(NMEAItem,0,Field)
If Field = "$GPRMC" Then
USART2.Write(Field)
NMEA.GetField(NMEAItem, 9, Field)
USART2.Write(" [Date ", Field, "]")
NMEA.GetField(NMEAItem, 1, Field)
USART2.Write(", [Time ", Field, "]", 13, 10)
USART2.Write(13, 10)
EndIf
EndIf
Wend
Best Regards.

Mikayo

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Mon Oct 15, 2007 8:34 am

whith this line, it's ok

#option USART_BRGH = false

Post Reply