element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of the Backyard
  • Challenges & Projects
  • Design Challenges
  • Internet of the Backyard
  • More
  • Cancel
Internet of the Backyard
Blog [iot_umbrella] #9 gps module – description
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: .lukasz.
  • Date Created: 26 Oct 2014 6:46 AM Date Created
  • Views 628 views
  • Likes 1 like
  • Comments 0 comments
  • iot_backyard
  • iot_umbrella
Related
Recommended

[iot_umbrella] #9 gps module – description

.lukasz.
.lukasz.
26 Oct 2014

In my umbrella project I used gps module. After start  device turn on gps module and waiting for geographic position . Latitude and longitude values are used in weather forecast algorithm.

 

If user dont have gps module, then he can turn off gps positioning function in umbrella code (c/c++ compiler -> options -> proprocessor -> defined symbols ,,, and remove GPS_IN_USE ). After that user must set name of city where umbrella is located (definition in configure.h file). When gps module is turn off, weather forecast alghoritm working using city name.

 

 

In project I used Quectell L80 GPS module with an embedded patch antena, but umbrella software is compatible with every gps module working in NMEA 0183 standard.

 

image

 

L80 is very good module based on MTK chipset. L80 is „low power” small and combines with many advanced features including EASY, AIC, LOCUS, AlwaysLocate  and  Antenna Advisor. These features are beneficial to accelerate TTFF, improve sensitivity, save consumption and detect antenna status for GPS system. The module supports various location, navigation and industrial applications including autonomous GPS, SBAS (including WAAS, EGNOS, MSAS, and GAGAN), QZSS, and AGPS.

 

http://www.quectel.com

http://www.quectel.com/product/prodetail.aspx?id=62

 

image

 

 

CC3200 communicate with L80 via UART (9600bps, 8N1).

The L80 module supports 2 protocols:

- NMEA – positioning data ( output )

- PMTK – gps module configuration ( input )

  In umbrella project I dont  use PMTK protocol. L80 working with default configuration.


image


On the  L80 NMEA output are avalible GPRMC, GPVTG, GPGSA, GPGSV, GPGLL GPTXT  commands. In umbrella software I analize only one command: GPRMC. 



image

I wrote simple state machine. In  am checking L80 output NMEA chars and I am wait for „$GPRMC” string. If I found this string I am checking gps state (A-active, V-inactive). If gps position is active ( A state) then I am waiting form end of gprmc command. Then I check command CRC. If CRC code is corected then I finishign gps positioning procedure and I read latiotude and longitude values.


uInt8 GpsRmcFrame()
{ 
    uInt8 l_byte;
   

    l_byte =   UartA0Get();
                                                  
    switch(g_level)                 
    {
        case 0:  
                  if(l_byte == '$') 
                  {            
                      g_level    = 1;
                      g_index    = 0; 
                      g_buffor[g_index++] = l_byte;   
                  }     
                  break;
                 
        case 1:    
                  g_level = 0;
                  if(l_byte == 'G')
                  {                    
                      g_crc     = l_byte;
                      g_level   = 2;
                      g_buffor[g_index ++] = l_byte;
                  }
                  break;  
                 
        case 2: 
                  g_level = 0;
                  if(l_byte == 'P')
                  {                    
                      g_crc ^= l_byte;
                      g_level   = 3;
                      g_buffor[g_index ++] = l_byte;
                  }
                  break; 
                 
        case 3:
                  g_level = 0;             
                  if(l_byte == 'R')
                  {                    
                      g_crc ^= l_byte;
                      g_level   = 4;
                      g_buffor[g_index ++] = l_byte;
                  }
                  break; 
                 
        case 4:  
                  g_level = 0;        
                  if(l_byte == 'M')
                  {                    
                      g_crc ^= l_byte;
                      g_level   = 5;
                      g_buffor[g_index ++] = l_byte;
                  }
                  break; 
                 
        case 5: 
                  g_level = 0;             
                  if(l_byte == 'C')
                  {                    
                      g_crc ^= l_byte;
                      g_level   = 6;
                      g_buffor[g_index ++] = l_byte;
                  }
                  break; 
                 
        case 6:   
                  g_crc ^= l_byte;
                  g_buffor[g_index ++] = l_byte;
               
                  if(g_index == 19)
                  {
                    if(l_byte == 'A')
                       g_level = 7;
                    else
                       g_level = 0;
                  }
                  break;
                 
        case 7:
         
                g_crc ^= l_byte;
                g_buffor[g_index ++] = l_byte;
         
                if(g_index ==  82)     
                                      g_level = 0;
                if(l_byte  == '*')        
                                      g_level = 8;  
                break;
               
        case 8:  

                g_level = 0;
                g_crc  ^= '*';
                g_buffor[g_index ++] = l_byte;
               
                if(l_byte >= 'A' && l_byte <= 'F')                                    
                l_byte = l_byte - 'A' + 10; 
               
                if(l_byte >= '0' && l_byte <= '9')
                l_byte = l_byte - '0';
               
                if( (g_crc >> 4) == l_byte )
                                      g_level = 9; 
                break; 
       
        case 9:  
                g_level = 0;
                g_buffor[g_index ++] = l_byte;
               
                if(l_byte >= 'A' && l_byte <= 'F')                                    
                l_byte = l_byte - 'A' + 10; 
               
                if(l_byte >= '0' && l_byte <= '9')
                l_byte = l_byte - '0';
               
                if( (g_crc &= 0x0f) == l_byte )
                                     g_level = 10; 
                break;                                                            
     
        case 10: 
                  g_level = 0;  
                  g_buffor[g_index ++] = l_byte;
                  
                  if(l_byte == 0x0D)
                                    g_level  = 11;
                  break;  
                 
        case 11: 
                  g_level = 0; 
                  g_buffor[g_index ++] = l_byte;
                  
                  if(l_byte == 0x0A)
                  { 
                     return 1;                  // is complete rmc frame
                  }                 
                  break;  

        default:
                  g_level = 0;
                  break;       
    }   
   
    return 0;
}


sechematic:


image


final:



image

 

b.r.

Lukasz, Poland




  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube