element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog Fun With UART, Global Navigation Satellite Systems (GNSS) and Teseo III
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 18 Jul 2024 9:36 PM Date Created
  • Views 823 views
  • Likes 7 likes
  • Comments 8 comments
  • i2c
  • uart
  • Teseo
  • gps
  • teseo_c++
Related
Recommended

Fun With UART, Global Navigation Satellite Systems (GNSS) and Teseo III

Jan Cumps
Jan Cumps
18 Jul 2024

This article is related to  Fun With Arduino, Global Navigation Satellite Systems (GNSS) and Teseo III . At a lower level though: interaction with the UART interface. The "Fun with Arduino" post of shabaz provides an Arduino sketch to talk to a Teseo-LIV3. That firmware uses UART to get info off the GPS. I'm going to do some of these things from a terminal. Read what the Teseo sends. And try to control that stream of info.

image

I'm investigating this to understand how this GPS behaves. I'm writing an I2C program for it, and it's hard to understand why and how I receive data. Fortunately, the I2C and UART interface are the same, except for the transport layer. Because it's easier to free-wheel a conversation with a terminal over UART, I'm going that way today. For a selected number of commands, I have to use another bit, to indicate I'm using the UART interface. But that's where the difference in logic ends.

Instead of having to go through a flow of  code-change, build and inspect i2C trafic cycle,
I can test all interactions via the serial monitor. And that's really easier.

Hardware needed:

  • a UART (3.3V) to USB COM Port converter. I used a picoprobe. Any pass-through UART to USB will work.
  • 5V power. Also delivered by that picoprobe in my setup.

Commands I've tested:

$PSTMSRR: reset

$PSTMSAVEPAR: save current settings in flash

$PSTMGPSSUSPEND: stop engine

$PSTMGPSRESTART: start engine

$PSTMCFGMSGL,0,1,0,0: clear UART list (this is the only one that's UART specific in my scenario. For I2C the first parameter is 3 instead of 0.

$PSTMSETPAR,1227,1,2: disable overeager messaging

$PSTMRESTOREPAR: restore to original settings. Undo flash write

$PSTMNMEAREQUEST,100000,0: request location

$PSTMNMEAREQUEST,40,0: request time

Here's the result of a few exchanges:

image

image:I managed to tame the output. It only returns what I ask, instead of a regular flow of all data.

That's it. A simple post that shows that you can control the behaviour in a very similar way with I2C or UART. 

  • Sign in to reply
  • Jan Cumps
    Jan Cumps 10 months ago

    for documentation: this is the out-of-box flow of data

    $PSTMSWCONFIG,1,0,12,000205f105070a0a0e0d0c0b0a090608070203630e110c04180c0155030110500f00000f071402050a40ffffffffffffffffffffffffffffffffffffffffffff*1E
    $PSTMSWCONFIG,1,1,12,ffffffffffffffffffffffffffffffffffffffffffffffffffff010101000001094005ffffffffff5c1663095600980000000000000000000000000000000000*40
    $PSTMSWCONFIG,1,2,12,ffffffff00010000ffffffff000000000000000000000000ffffffff000100000019000000000000fffffffffffffffffffffffffffffffff090c02b05282000*4D
    $PSTMSWCONFIG,1,3,12,01323200050358020a0a0000fe03000010f083340d040104000002000000000000000000560098000000020000000000000000000000000000000000ac07730d*44
    $PSTMSWCONFIG,1,4,12,120000009a106464ae6184002f0001000000000000000000000000000a00000007000000ffffffff050000000100000015000000b004780503000000f0c3f7ff*4C
    $PSTMSWCONFIG,1,5,12,00000000ffffffff000000000c0a00020fb4a005f5a30000010a1900330a0a1400510000810e003300001810000008000e01000000000000020f000000000000*43
    $PSTMSWCONFIG,1,6,12,0000e803ffffffff0610000080ba8c014810c703ffffffff9abed2e6edf2fafb0000020205060101ff00ff00ff00ff00ff00ff00ff00ff0000000000ffffffff*4D
    $PSTMSWCONFIG,1,7,12,0000000000000000000000000000e03f0000000000000000000000000000f03fd3872ea86f754440938c9c853d8d2c403db83b6bb71b56404b0484b86d3da53e*40
    $PSTMSWCONFIG,1,8,12,0cb8df888b2f9c3e2b69a4292b1b503e0cb8df888b2f9c3e4b0484b86d3da53e000000000000000000000000000000005feffe78af8e44406c21c84109c32b40*4B
    $PSTMSWCONFIG,1,9,12,00000000000024401d8f19a88c8f4440598b4f0130be2b4000000000000024407ac2120f289f44402315c616828c2b400000000000002440ace28dcc239f4440*11
    $PSTMSWCONFIG,1,10,12,95826e2f698c2b4000000000000024400f0c0c120f0c0c120f0c0c120f0c0c1244454641554c54204c495633464c20434f4e46494755524154494f4e00000000*7D
    $PSTMSWCONFIG,1,11,12,00000000000000000000000000000000000000000000000000000000000000000000000000000000*26
    $GPRMC,185427.150,V,5051.83778,N,00422.55809,E,,,240724,,,N*7F
    $GPGGA,185427.150,5051.83778,N,00422.55809,E,0,00,99.0,160.24,M,0.0,M,,*62
    $GPVTG,,T,,M,,N,,K,N*2C
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GPGLL,5051.83778,N,00422.55809,E,185427.150,V,N*4F
    $PSTMCFG,LMS,1,0,0,50.0,50.0,05,03,60.0,0.000000,0.000000,-2.671600*12
    $PSTMCPU,46.72,-1,98*44
    $GPRMC,185428.000,V,5051.83778,N,00422.55809,E,,,240724,,,N*74
    $GPGGA,185428.000,5051.83778,N,00422.55809,E,0,00,99.0,160.24,M,0.0,M,,*69
    $GPVTG,,T,,M,,N,,K,N*2C
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GPGLL,5051.83778,N,00422.55809,E,185428.000,V,N*44
    $PSTMCPU,46.72,-1,98*44
    $GPRMC,185429.000,V,5051.83778,N,00422.55809,E,,,240724,,,N*75
    $GPGGA,185429.000,5051.83778,N,00422.55809,E,0,00,99.0,160.24,M,0.0,M,,*68
    $GPVTG,,T,,M,,N,,K,N*2C
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GPGLL,5051.83778,N,00422.55809,E,185429.000,V,N*45
    $PSTMCPU,39.40,-1,98*4D
    $GPRMC,185430.000,V,5051.83778,N,00422.55809,E,,,240724,,,N*7D
    $GPGGA,185430.000,5051.83778,N,00422.55809,E,0,00,99.0,160.24,M,0.0,M,,*60
    $GPVTG,,T,,M,,N,,K,N*2C
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GNGSA,A,1,,,,,,,,,,,,,99.0,99.0,99.0*1E
    $GPGLL,5051.83778,N,00422.55809,E,185430.000,V,N*4D
    $PSTMCPU,39.40,-1,98*4D
    
    ...
    
    $GPRMC,191237.000,A,5051.78066,N,00422.57079,E,0.3,45.7,240724,,,A*55
    $GPGGA,191237.000,5051.78066,N,00422.57079,E,1,05,3.7,027.26,M,47.3,M,,*65
    $GPVTG,45.7,T,,M,0.3,N,0.6,K,A*3E
    $GNGSA,A,3,15,18,,,,,,,,,,,4.7,3.7,2.9*2D
    $GNGSA,A,3,73,65,81,,,,,,,,,,4.7,3.7,2.9*2E
    $GPGSV,3,1,11,13,79,310,,14,53,113,,05,51,214,,30,47,067,*72
    $GPGSV,3,2,11,15,45,295,24,22,44,145,,20,27,192,,07,16,064,*7A
    $GPGSV,3,3,11,18,16,298,25,24,08,249,,08,08,029,18,,,,*40
    $GLGSV,2,1,08,72,79,113,,74,77,084,,75,38,202,,65,37,317,28*68
    $GLGSV,2,2,08,73,34,040,35,71,28,130,,81,13,333,24,82,08,017,*68
    $GPGLL,5051.78066,N,00422.57079,E,191237.000,A,A*50
    $PSTMCPU,40.28,-1,98*4D

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz 10 months ago in reply to Jan Cumps

    They say (well, my mgr used to say!) Every problem is simply just an opportunity to excel!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB 10 months ago

    Nice update Jan.

    I have just begun to use GPS receivers on some of my cameras.

    I was very surprised at how robust the receiver section was to angle orientation.

    I found they worked even at 90 degrees to horizontal.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 10 months ago in reply to Jan Cumps

    this turned out to be a lucky event. The fact that some commands return multiple lines and a status line, forced me to build a multiline capable reader.

    But in essence, every "query" command returns at least two lines. The reply (1 line in case of a simple command) and a status line..

    Solving the GPGSV took care that my code could also handle a normal command better.
    I created code that understand (1..n) reply lines and a status line. Should handle all cases, including validation


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 10 months ago

    I found a command that doesn't nicely fit in my reply-response paradigm: GPGSV.

    Unlike GPGLL and GPRCM, it returns multiple lines. That means I have to adapt the reader functions and the class of my Teseo lib to deal with such scenarios...

    ---- Sent utf8 encoded message: "$PSTMNMEAREQUEST,80000,0\r\n" ----
    $GPGSV,3,1,12,03,82,292,,02,54,132,21,17,48,278,,21,37,130,*7A
    $GPGSV,3,2,12,04,37,183,,19,33,308,19,28,20,062,,31,16,096,*7C
    $GPGSV,3,3,12,06,11,302,,22,07,267,,09,07,204,,32,05,037,*71
    $GLGSV,2,1,07,88,66,314,20,72,65,044,26,87,51,144,20,65,51,219,*62
    $GLGSV,2,2,07,71,15,039,29,81,13,322,32,80,11,358,35,,,,*58
    $PSTMNMEAREQUEST,80000,0
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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