problem with connection between gps evalution board and sk40

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

Re: problem with connection between gps evalution board and sk40

Postby chuaweekok » Mon Mar 22, 2010 10:31 am

i only design the porgram so that only display the first 16 character from USart
so, when more than 16 word is type in hyperterminal, the 16 character remain on LCD.
chuaweekok
Newbie
 
Posts: 14
Joined: Wed Mar 17, 2010 12:49 pm

Re: problem with connection between gps evalution board and sk40

Postby waiweng83 » Mon Mar 22, 2010 10:58 am

can u capture a photo of your connection and the characters displayed on the LCD when you connect the SK40C to the GPS?
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: problem with connection between gps evalution board and sk40

Postby chuaweekok » Mon Mar 22, 2010 11:20 am

i have change my testing code
CODE: SELECT_ALL_CODE
if(Usart_Data_Ready()==1 & mystat==0)
 { rec=Usart_Read(); mystat=1;  }

if(mystat==1)
{
cnt++;
Lcd_Custom_Chr(1,cnt,rec);
mystat=0;
if(cnt>16){ Lcd_Custom_Chr(2,cnt-16,rec);}
if(cnt>32){cnt=1; Lcd_Custom_Cmd(Lcd_First_Row);}


only can see different character but not NMEA code

i cannot upload photo
i send the photo to ur mail
chuaweekok
Newbie
 
Posts: 14
Joined: Wed Mar 17, 2010 12:49 pm

Re: problem with connection between gps evalution board and sk40

Postby waiweng83 » Tue Mar 23, 2010 1:51 pm

chuaweekok WROTE:i only design the porgram so that only display the first 16 character from USart
so, when more than 16 word is type in hyperterminal, the 16 character remain on LCD.


From your source code, I can't find which part is doing this. From my understanding, once the character is over 16, it will jump to 2nd row. After 32 character, it jump back to first row again. If this is correct, you will just see the random character showing on the LCD because the GPS keeps sending data to the MCU.
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: problem with connection between gps evalution board and sk40

Postby chuaweekok » Tue Mar 23, 2010 4:46 pm

the previous source that i send is just for testing the usart to display on lcd
cause i didnt accept anything in the original source code for interpret NMEA code

waiweng83 WROTE:If this is correct, you will just see the random character showing on the LCD because the GPS keeps sending data to the MCU.


so, i think the character display on LCD also should also be part of the NMEA code and not just random character that cant be interpret although the character display is keep replace by new character.

below is the original code for interpret NMEA code and output to LCD.
CODE: SELECT_ALL_CODE
while(1)
{

n = 0;;

for(n =0; n <10; n ++)
{
if (Usart_Data_Ready() == 1)
      {receive = Usart_Read();                                                     // Copy usart data to receive.
      Usart_Write(receive);
      cnt++;
      }
     
   if (receive == ',' )
   {receive = ' '; rec2++; cnt = 0; n = 0;
   }
   else if ( receive == 'C' )
   {receive = ' '; rec1 = 1;
   }
   else if (receive == '*')
   {receive = ' '; rec1 = 0; rec2 = 0; n = 10;
   }
   else {
   receive = ' ';
    if( cnt != 0 && rec1 == 1 && rec2 == 3)
     {latitude[cnt-1]=Usart_read();                                                // Copy Usart data to latitude.
      }
    else if( cnt != 0 && rec1 == 1 && rec2 == 5)
     {longitude[cnt-1]=Usart_read();                                                        // Copy Usart data to longitude.
      }
    else if( cnt != 0 && rec1 == 1 && rec2 == 8)
     {course[cnt-1]=Usart_read();                                                           // Copy Usart data to course.
      }
      }
}

LCDdisplay();
}
}



void LCDdisplay(void)
{

for(cnt1=0; cnt1 < 11; cnt1++)
{ Lcd_Custom_Chr(1,cnt1+7,latitude[cnt1]);
  Lcd_Custom_Chr(2,cnt1+6,longitude[cnt1]);
}


I didnt using this code to test usart connection because the character i accept from usart in just random character.
chuaweekok
Newbie
 
Posts: 14
Joined: Wed Mar 17, 2010 12:49 pm

Re: problem with connection between gps evalution board and sk40

Postby waiweng83 » Wed Mar 24, 2010 10:51 am

how about you try the following code?

CODE: SELECT_ALL_CODE
if(Usart_Data_Ready()==1 & mystat==0)
{
   rec=Usart_Read();
   mystat=1;
}

if(mystat==1)
{
   cnt++;
   Lcd_Custom_Chr(1,cnt,rec);
   mystat=0;

   if(cnt>16)
   {
      Lcd_Custom_Chr(2,cnt-16,rec);
   }

   if(cnt>32)
   {
      cnt=33;
   }
}


If count > 32, it will do nothing.
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: problem with connection between gps evalution board and sk40

Postby chuaweekok » Wed Mar 24, 2010 2:45 pm

the LCD display still tha same, but just the character didnt change
The LCD displayed "$GP" followed by other random character "%", "ll", "b", "i", and other.
chuaweekok
Newbie
 
Posts: 14
Joined: Wed Mar 17, 2010 12:49 pm

Re: problem with connection between gps evalution board and sk40

Postby waiweng83 » Fri Mar 26, 2010 11:04 am

This looks strange to me :(
Another possibility is the NMEA character is coming in too fast and the MCU does not manage to process all character.

How about changing the baud rate of the GPS to lower value, let say 9600? FYI, you will need to connect your GPS module to the PC and use the miniGPS software to change the baud rate. After changing the baud rate, don't switch off the power to the GPS module. The setting will be reset to default value if you switch off the power.
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: problem with connection between gps evalution board and sk40

Postby chuaweekok » Fri Mar 26, 2010 5:35 pm

i have changed the baudrate to 9600 and fix updata rate to 1 using miniGPS 1.41.
when testing using hyperterminal with 9600 baudrate, the NMEA code is normal.
when testing with the hardware and the source code of 9600 baud rate, the LCD still display the same unknown charater.
chuaweekok
Newbie
 
Posts: 14
Joined: Wed Mar 17, 2010 12:49 pm

Re: problem with connection between gps evalution board and sk40

Postby waiweng83 » Sat Mar 27, 2010 4:19 pm

Is the UART of the PIC having overrun error?
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

PreviousNext

Return to Sensor

Who is online

Users browsing this forum: No registered users and 4 guests

cron