7 Replies Latest reply on Mar 7, 2015 8:55 AM by user_1377889

    Need help to interface GPS to PSoC4

    sarang.suryawanshi

      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-algorithm-example#88323

         

      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

        • 1. Re: Need help to interface GPS to PSoC4
          user_242978793

          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. 

          • 2. Re: Need help to interface GPS to PSoC4
            sarang.suryawanshi

            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

            • 3. Re: Need help to interface GPS to PSoC4
              user_78878863

              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).

              • 4. Re: Need help to interface GPS to PSoC4
                user_1377889

                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

                • 5. Re: Need help to interface GPS to PSoC4
                  user_242978793

                   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-example#88441

                  • 6. Re: Need help to interface GPS to PSoC4
                    sarang.suryawanshi

                    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

                    • 7. Re: Need help to interface GPS to PSoC4
                      user_1377889

                      Great that you got it to work!

                         

                       

                         

                      Bob