Need help to interface GPS to PSoC4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

I am new to PSoC4. I am trying to interface GPS http://www.progin.com.tw/mr87_en.htm with PSoC4.
I got an example project at http://www.element14.com/community/message/88323/l/psoc-4-pioneer-kit-community-project086-gps-algor...

   

It works perfectly to echo the string that I sent using hyperterminal (.jpg file inside the attached project), but does not display the longitude and latitude on LCD (LCD just displays only "GPS Shield"). So the logic for displaying over LCD has some logical error.

   

In my project (attached herewith), I have used the LCD component API provided by PSoC Creator 3.1(one in the example is obsolete)

Please let me know, what is causing the error.

Regards,
Sarang

0 Likes
7 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

What model of GPS module are you using?  Also if you look at the example the baud rate for the module  it is set to 57000 not 4800 like your program.  Also the uart setup is different.  It has an external clock. Your design is displaying the setup message but not data from the GSM module.  So it has to be due to the baud rate settings or your UART settings for the uart that connects to the GPS module.  Also you are using a different lcd module but that is working as you are getting the startup message. 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thank you Bobgoar for your prompt reply.

   

Hey I am using GPS module: ProGin MR-87  http://www.progin.com.tw/mr87_en.htm   at baud rate of 4800. So I have set UART_G at baud rate of 4800.

   

I the example at element14, the baud rate of UART_G is 9600(may be because most of the modules works at 9600   attached .jpg). You said baud rate 57000 but I neither see baud rate 57000 nor an external clock anywhere.

   

As you rightly pointed out, I can see the startup message only but not the GPS co-ordinates.

   

Please help.

   

Regards,

   

Sarang

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When you can see the startup message from the GPS module, the UART communication is probably OK. But you sais that the baud rate for UART_G is 4800 - the screenshot shows it at 9600.

   

Looking at your source code: maybe you should try to print the message itself to the LCD (or at least the firsz 16 characters) for a start. it might just be that your parsing is wrong, which would mean you never get to the state where the main loop prints the data to the LCD.

   

As debugging aid, one can toggle one or more LEDs according to the state the system is in (e.g. whenever a character is received, and then when the parsing was OK).

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Reduce your project to get the message from GPS and directly send it to your UART_DBG, so you can see if the communication is o.k. Errors could be:

   

Wrong connection between GPS and UART_G

   

Different baud rate between GPS and UART_G

   

And: If you are used to, why don't you write a function

   

void   LCD_PosPrintString(uint8 Line, uint8 Column, char String[]); // Write String to given position

   

can make your life easier.

   

 

   

Bob

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

 How about using the debug function in Psoc Creator and check this dataByte using the debug function.  See if you are getting anything from the GPS module.  Did you try this example with your hardware. http://www.element14.com/community/message/88441/l/psoc-4-pioneer-kit-community-project089-gps-examp...

0 Likes
Anonymous
Not applicable

So sorry all (Hli, Bob Marlowe, Bobgoar) to reply late.

   

 

   

Actually I was busy tressing out the problem, and finally found out the solution. Working perfectly!!!

   

 

   

Hli thank you, to increase my confidence by letting me know that communication is working perfeclty "OK"

   

Bob Marlow thank you, for telling " get the message from GPS and directly send it to your UART_DBG" and letting me know the probable error points "connection between GPS and UART_G","Baud rate". Hey Bob, void LCD_PosPrintString(); function is not supported by PSoC  Creator 3.1 SP1. So I have used to separate functions (for position and string).

   

Bobgoar thank you, I tried implementing your suggestion finally.

   

Guys, the mistake I been doing was absolute silly.  In my GPS  ProGin module it has MAX232 as well, so I was getting correct GPS co-ordinates on Hyperterminal using USB-to-UART adapter to GPS module's female connector, but could not get correct output ( could get garbage) when I used the same female connector of GPS to connect to Pioneer Kit UART_G (as I was not getting TTL level output because of MAX232)

   

Now I have directly connected MAX 232 T2IN pin (pin 10) [i.e. excluded MAX 232] to PSoC UART_G at 4800 baud rate and damn I got the correct co-ordinates on the Hyperterminal.

   

 

   

 Now I am trying to get Time, Longitude and Latitude out of the NMEA sting that is received.

   

 

   

Regards,

   

Sarang

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Great that you got it to work!

   

 

   

Bob

0 Likes