Die Schnitstelle funktioniert ja in beide Richtungen, nur kann der Atmega8 anscheinend nicht mit dem Garmin. Der RS232 / TTL Wandler ist ein Bausatz von Pollin.
Code:
$regfile = "m8def.dat"                                      ' ATmega8L 8PU
$crystal = 3686400                                          ' für myAVR Board USB
$baud = 4800                                                ' NMEA Schnittstelle

Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2

Dim C As Byte
Dim I As Byte
Dim Stime As String * 6
Dim Sdate As String * 6
Dim Soutput As String * 8

Declare Sub Wait_for_char(byval C As String)
Declare Sub Wait_for_string(byval S As String)
Declare Function Read_string() As String

Cls
Cursor Off Noblink

Lcd "Lese $GPRMC..."
Wait 2
Cls
Config Serialin = Buffered, Size = 100                      ' Konfig. der ser. Eingabe
'Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Enable Interrupts

' $GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh          NMEA Protokoll orig.
' $GPRMC,140942,A,4923.3757,N,01117.6031,E,0.0,167.0,120408,1.4,E,A*13     NMEA Protokoll Garmin etrex Summit
'-------------------------------------------------
Do
   Call Wait_for_string("$GPRMC,")                          ' Warte auf $GPRMC
   Stime = Read_string()                                    ' Lese UTC Zeitangabe
   Soutput = Left(Stime, 2) + ":" + Mid(Stime, 3, 2) + ":" + Mid(Stime, 5, 2)
   Locate 1, 1
   Lcd Soutput;

   For I = 1 To 7                                           ' Lese 7 Kommata
      Call Wait_for_char(",")
   Next
   Sdate = Read_string()
   Soutput = Left(Sdate, 2) + "." + Mid(Sdate, 3, 2) + "." + Mid(Sdate, 5, 2)            ' Lese Datum
   Locate 2, 1
   Lcd Soutput;

Loop
End
'-------------------------------------------------
Sub Wait_for_char(ByVal C As String)
Local Cc As Byte
Do
   Cc = Waitkey()
Loop Until Cc = Chr(C)
End Sub
'-------------------------------------------------
Sub Wait_for_string(byval S As String) As String
Local Ii As Byte
Local Cc As Byte

Ii = 1
M1:
   Cc = Waitkey()
   If Cc <> Mid(S, Ii, 1) Then
      GoTo M1
   Else
      Incr Ii
      If Ii > Len(S) Then GoTo M2
      GoTo M1
   End If
M2:
End Sub
'-------------------------------------------------
Function Read_string() As String
Local Cc As Byte
Local Ss As String * 7
ss = ""
Do
   Cc = Waitkey()
   ss = ss + Chr(Cc)
Loop Until Cc = ","
Read_string = Left(ss, 6)
End Function