Hallo, ich empfange am Hyperterminal zwar den GPS-Datenblock, aber leider stimmen nicht alle zeichen überein, die meisten entsprechen in der ASCII Tabelle das vorhergehende Zeichen(z.b. $ ersetzt duch % oder , ersetzt durch -). Es wird immer der selbe Datenblock empfangen, womit Übertragungsfehler und Timingprobleme unwahrscheinlich sind. Und einige Zeichen werden ja richtig empfangen. Hyperterminalauszug : Dies ist ein NMEA-Datenblock wie er aussehen sollte: $GPGSV,3,1,12,03,42,282,00,06,16,095,00,07,63,092,00,16,72,233,00*71 $GPGSV,3,2,12,18,33,123,00,19,15,275,00,21,62,072,00,22,14,158,00*75 $GPGSV,3,3,12,25,02,208,00,27,09,332,00,29,02,050,00,31,00,199,00*74 $PGRME,,M,,M,,M*00 $GPGLL,,,,,150554,*50 $PGRMZ,,,*7E $PGRMM,WGS 84*06 $GPBOD,,T,,M,,*47 $GPWPL,5241.364,N,00517.662,E,ENKSLS*45 $GPRMC,150555,V,,,,,,,211106,,*35 $GPRMB,V,,,,,,,,,,,,V*66 $GPGGA,150555,,,,,0,00,,,M,,M,,*67 $GPGSA,A,1,,,,,,,,,,,,,,,*1E Das Hyperterminal zeigt aber folgendes Ergebnis: %GQGSW-3-1-13-13-55-393-11-17-15-197-11-17-71-195-11-17-71-333-11+71 %GQGSW-3-3-13-19-35-131-11-19-17-377-11-31-59-179-11-33-17-157-11+7E %GQGSW-3-3-13-35-11-317-11-37-11-171-11-37-11-331-11-39-13-157-11+75 %QGSME--M--M--M+11 %GQGMM-----151319-+5E %QGSM[---+7E %QGSMM-WGS!95+17 %GQCOE--U--M--+57 %GQWQM-5351/959-O-11517/11 %GQSMC-151331-W-------311117--+31 %GQSMC-W------------W+77 %GQGGA-151331-----1-11---M--M--+73 %GQGSA-A-1---------------+1E Code: while(1) { PORTC &= ~( 1 << PC0 ); // xxxx xxx0 -> CSA = 0 ->> Auswahl tl16c550b PORTB = 0x05; // line status register PORTC &= ~( 1 << PC4 ); // xxx0 xxxx -> IOR = 0 ->> lesen vom tl16c554 puffer=PINA; PORTC |= (1 << PC4); // xxx1 xxxx -> IOR = 1, kein lesen PORTC |= ( 1 << PC0 ); // xxxx xxx1 -> CSA = 1 if (puffer & 1) { // prüfen auf data ready PORTC &= ~( 1 << PC0 ); // xxxx xxx0 -> CSA = 0 ->> Auswahl tl16c550b PORTB = 0x00; // 0000 0000 A2A1A0=000 Receiver Buffer PORTC &= ~( 1 << PC4 ); // xxx0 xxxx -> IOR = 0 ->> lesen vom tl16c554 usart_putc(PINA); // Ausgabe hyperterminal PORTC |= (1 << PC4); // xxx1 xxxx -> IOR = 1, kein lesen PORTC |= ( 1 << PC0 ); // xxxx xxx1 -> CSA = 1 } }
Recht offensichtlich, welche Zeichen verändert wurden: alle geraden ASCII-Werte wurden um 1 erhöht, also ist das LSB grundsätzlich gesetzt.
puffer=PINA; if (puffer & 1) { // prüfen auf data ready usart_putc(PINA); } Da war einer schneller ;-))
Danke für eure beiden Denkanstöße. Es ist wohl doch ein Timingproblem. Folgender Code brauche eine leichte "Verbesserung" ;) while(1) { PORTC &= ~( 1 << PC0 ); // xxxx xxx0 -> CSA = 0 ->> Auswahl tl16c550b PORTB = 0x05; // line status register PORTC &= ~( 1 << PC4 ); // xxx0 xxxx -> IOR = 0 ->> lesen vom tl16c554 puffer=PINA; PORTC |= (1 << PC4); // xxx1 xxxx -> IOR = 1, kein lesen PORTC |= ( 1 << PC0 ); // xxxx xxx1 -> CSA = 1 while (!(puffer & 1)) { //warte bis data ready PORTC &= ~( 1 << PC0 ); / xxxx xxx0 -> CSA = 0 ->> Auswahl tl16c550b PORTB = 0x05; // line status register PORTC &= ~( 1 << PC4 ); // xxx0 xxxx -> IOR = 0 ->> lesen vom tl16c554 puffer=PINA; PORTC |= (1 << PC4); // xxx1 xxxx -> IOR = 1, kein lesen PORTC |= ( 1 << PC0 ); } if (puffer & 1) { // data ready PORTC &= ~( 1 << PC0 ); // xxxx xxx0 -> CSA = 0 ->> Auswahl tl16c550b PORTB = 0x00; // 0000 0000 A2A1A0=000 Receiver Buffer PORTC &= ~( 1 << PC4 ); // xxx0 xxxx -> IOR = 0 ->> lesen vom tl16c554 usart_putc(PINA); //Ausgabe Hyperterminal PORTC |= (1 << PC4); // xxx1 xxxx -> IOR = 1, kein lesen PORTC |= ( 1 << PC0 ); // xxxx xxx1 -> CSA = 1 } } %GQGSW-3-1-13,11-19,353,11,13-19,137,11-15,11-117-11,17,79,173-11+75 %GQGSW-3-3,13-17,51-357-11,11-13,171,11-17,19-393-11,31-31,173,11+7E $GQGSW,3-3,13,33,11,337,11-35,51,377,11-31,54-117-11,31-57,353,11+7C $QGSME,-M-,M,-M+11 %GQGML-,-,-133137,+55 $QGSM[,,,+7E %QGSMM-WGS!84+17 %GQCOD,,U,-M,,+57 %GQWQL-5341/374,O,11517/773-E-EOKSLS+45 %GQSMC-133137,W,-,-,-,331117-,+33 %GQSMC-W,,,,-,-,,,-,W+77 $GQGGA,133138,,,,-1-11,-,M,-M-,+7C $GQGSA,A,1,-,-,,,,,,-,-,-+1E
Durch ein schreiben von 0x00 auf den Datenbus zwischen den Lesevorgängen lies sich das Problem beheben, mit folgendem Ergebnis :) $GPGSV,3,1,12,03,84,197,00,07,19,121,00,08,11,317,00,11,05,256,00*7C $GPGSV,3,2,12,16,28,185,00,18,42,064,00,19,57,294,00,21,18,067,00*79 $GPGSV,3,3,12,22,55,122,00,26,07,020,00,27,08,292,00,29,03,011,00*76 $PGRME,,M,,M,,M*00 $GPGLL,,,,,164745,*55 $PGRMZ,,,*7E $PGRMM,WGS 84*06 $GPBOD,,T,,M,,*47 $GPWPL,5240.859,N,00516.103,E,KG13-B*2D $GPRMC,164746,V,,,,,,,221106,,*31 $GPRMB,V,,,,,,,,,,,,V*66 $GPGGA,164746,,,,,0,00,,,M,,M,,*6
Jürgen, könntest du bitte noch die nächsten NMEA Datenblöcke schicken? Danke Hans
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.