Hallo zusammen,

ich bin jetzt seid zwei tagen dran, mein GPS-Modul mit einem Mega32 auszulesen.
Ich dachte mir "kann nicht so schwer sein" es will aber nicht richtig laufen.

-Ist ein NL-552 von Navilock
-TTL mit 4800 baud
-Gibt NEMA aus

Zum testen will ich die "Daten" über die RS232 an meinen Pc ausgeben.
Ich hab jetzt nur mal "Print #1 , "hallo" in Do Loop geschrieben, aber nicht mal das kommt richtig an, 10-15 mal ist alles okay, dann folgen wieder ein paar Fehler.
Wenn ich "Disable Interrupts" einstelle läuft es. Ich habe also den Eindruck, wie als wenn mir der Hardware UART die ""Print #1 , "hallo" Ausgabe zerhacken würde.
Ich hoffe es hat einer von euch eine Idee. Danke schon mal.

Gruß Ronny

Code:
$regfile = M32def.dat
$crystal = 12000000
$baud = 4800

'------------------------------------------------------------------------------

Dim C As Byte
Dim I As Byte
Dim Sspeed As String * 11
Dim Stime As String * 11
Dim Sdate As String * 11
Dim Soutput As String * 11

'------------------------------------------------------------------------------

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

'------------------------------------------------------------------------------

Open "COMB.0:115200,8,N,1" For Output As #1
Wait 1
Print #1 , "lese ein"
Wait 1

'------------------------------------------------------------------------------

Config Serialin = Buffered , Size = 200
Enable Interrupts

'$GPRMC,235945.180,V,0000.0000,N,00000.0000,E,0.00,0.00,120136,,,N*74
'$GPVTG,0.00,T,,M,0.00,N,0.0,K,N*02
'$GPGGA,235945.180,0000.0000,N,00000.0000,E,0,00,99.9,-17.0,M,17.0,M,,0000*7C
'$GPGSA,A,1,,,,,,,,,,,,,99.9,99.9,99.9*09
'$GPGSV,1,1,00*79
'$GPGLL,0000.0000,N,00000.0000,E,235945.180,V,N*44

Do

Print #1 , "hallo"
Waitms 100

Loop

Close #1
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 * 10
Ss = ""
Do
   Cc = Waitkey()
   Ss = Ss + Chr(cc)
Loop Until Cc = ","
Read_string = Left(ss , 5)
End Function
End