Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 25 of 102

Thread: A UBlox GPS Module Primer for beginners

  1. #1
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    275

    A UBlox GPS Module Primer for beginners

    A cheap GPS module, with an electrical output signal that you can precisely control, is a very useful bit of equipment for Teensy testing or experimentation. The "UBlox NEO M8N module" is just such a piece of kit and is widely available at very low prices on eBay. The aim of this 'primer' is to share some experience on using this module with other Teensy users who may not be familiar with it.

    This GPS module is normally sold with its own small antenna, and when placed near a window with a clear sky view, will phase lock with both GPS and/or GLONASS satellites (even at the same time). When phase lock with four or more satellites is achieved, it can provide an electrical output signal that is precisely synchronised to Universal Co-ordinated Time (UTC). This output may be in the form of pulses having a user specified delay (w.r.t UTC) accurate to nanoSeconds, or the output can be specified as a frequency from 1 Hz to 10 MHz.

    The module that you purchase needs a little skill with a soldering iron first to make an electrical output signal available, and you will also need to purchase a "USB to Low Level TTL" cable if you want to use the free UBlox "U-center" software to drive it from a PC. These USB cables require a driver download to function, and there are a few surprises in store - as a USB device - for the unwary. But I hope to guide users through these "surprises" so that they can get up and running as quickly as possible.

    The following two pictures illustrate how the module needs to be modified in order to make the output signal available. These modules were never designed to have an output available, only to blink an on-board LED. But the UBlox component (via Pin 3) has this ability to control this pin signal via software, so by soldering a wired connection in parallel with the "102" resistor (that drives the LED), then you can make the pulses/frequencies available, as well as the LED. I normally solder two short wires to the module first (Orange = signal, Black = GND), and then use clip wires to connect to other devices. The output level is 3v3 so should be compatible with Teensy inputs - BUT MAKE SURE WITH A SCOPE FIRST BEFORE YOU CONNECT. I take NO RESPONSIBILITY if you damage your Teensy or other equipment !!! The responsibility for safe operation is YOURS to own ALONE. Ground returns and power supplies can throw up some unexpected situations.

    Click image for larger version. 

Name:	NEO M8N solder 1.jpg 
Views:	162 
Size:	94.8 KB 
ID:	11392 Click image for larger version. 

Name:	NEO M8N solder 2.jpg 
Views:	200 
Size:	192.2 KB 
ID:	11393

    The "surprises" with "USB to Low Level TTL converter" cables are a result of poor manufacturing. For Windows type PCs, you may plug the USB connector into a spare computer socket and then discover that your display screen goes "crazy" with "phantom mouse click" syndrome. Suddenly, the screen looks as if random "mouse-click" events are happening all over the place. And they won't stop happening until you remove the USB connector (which you should do).

    I confess to never having found a solution that works in all cases. The cause of this effect is the fact that the PC thinks your device is an alternative mouse type device - even though it isn't. That is because the driver for the chip inside the cable is not correctly configured. Some "phoney chips" have been produced to emulate genuine types, and the manufacturer may have changed the driver to try protect their business from being ripped off. Search the web if this happens to you as the problem is well known - and solutions do work - a common one is to download an earlier driver. Another issue that is involved is invalid VendorIDs or ProductIDs. The VID/PID combination is supposed to make USB devices unique and to allow the operating system to make the correct choice for a driver.

    I AM SORRY THAT I CANNOT SUPPLY DRIVER SOFTWARE, SO DON'T ASK ME - you will need to search the web for sources for your particular USB device. Again, this is your choice/responsibility.

    You may also want to check the "Device Manager" facility with WIN type PCs. Make sure that your device IS recognised under the USB "Ports (COM & LPT)" option, and make sure it is NOT recognised as "Mice and other pointing devices" (if it is then be careful to uninstall YOUR USB entry, and not that of your normal mouse - if you get this wrong, you could end up with losing mouse control completely). Again, this is YOUR RESPONSIBILITY to manage and not mine.

    If I get "phantom mouse" syndrome, I normally try unplugging - waiting a few seconds - then try plugging in again. It seems to be that one out of several attempts will be successful. Once it is successful, then it usually stays quiet until you disturb it. If you power down your PC, make sure that you leave the USB cable connected until shutdown is complete. Make sure the cable is also connected before you power up again next time - this is trying to maintain the same "configuration" that was working before. Also never power down with the "software" STILL CONNECTED to the device - you make this "connect" choice inside the U-Center software itself. AND NEVER, EVER, EVER change the USB device during the power up or power down phase (when in progress) - that can be catastrophic for the operating system.

    The problems associated with these USB converter cables is a real pain. But once you have it operational with the NEO M8N module, then the effort will be justly rewarded in the rich features that the module can provide.

    When you have the USB cable and the NEO M8N module plugged in and operationally working with your PC (stable and recognised in Device Manager), you are then ready to download the U-Center software and install it. You can find the download available here... https://www.u-blox.com/en/product/u-center-windows.

    With the U-Center software running, you need to select the RECEIVER PORT setting from the main menu. Below is an example picture.

    Click image for larger version. 

Name:	UCenter1.jpg 
Views:	157 
Size:	172.4 KB 
ID:	11394

    Here I have chosen the (menu option) VIEW - SKY VIEW window for the main area. Over on the far right you see the signal level sub-windows. When you first start up the software, if the module has been correctly recognised, then you will see some "Blue" signal indicators popping up. These remain "Blue" until the software/module has correctly identified at least four satellite signals. This can take quite some time from a "Cold Start". On the module itself, there is a steady power indicator LED to show that USB power is being used. Once four satellites have been "locked", then the module will start to blink its GREEN LED at a rate of one blink per second. This rate is configurable, as we shall see shortly. Also, when four satellites have been locked, the signal indicators for those satellites will change color to "Green". That signal will also now be available as an electrical output on your soldered ORANGE/BLACK wires. Check this with a scope.

    To change the signal output on your newly soldered wires, select VIEW-CONFIGURATION VIEW from the main menu. Expand this window to its full size. Scroll down (if needs be) and click the option "TP5 (Timepulse 5). The three most useful features of this TP5 facility for pulses are "Period Locked", "Length Locked" and "User Delay". Make your selection - as you desire - and then click on the SEND button in the bottom left-hand corner. Your selection will not alter the module until this SEND button is activated. Once sent, then the module will remember the commands you have sent it - even if you then disconnect the software completely.

    The "locked" selections can occasionally be interrupted, if the module loses its four satellites minimum signal requirement. At that point, you will see the signal indicators go all "Blue" and remain that way until lock is re-established. They normally come back again, but this all depends on the quality of the signals that your MODULE ANTENNA is receiving. Also, when you lose the lock condition, the output pulse to your soldered wires will also be interrupted - as will the blink of the GREEN LED.

    The U-Center software has far too many options for me to be able to describe in this primer. I leave most of these for users to explore and experiment with.

    One last word of advice... the signals that you extract via your soldered wires are "fragile" in respect of the signal propagation down the wiring to whatever device you hook them up to. The "transmit" output of the M8N module expects to see "correct propagation impedance termination" applied to your output. This is not normally an issue below 1 MHz output conditions. But when you start to move upwards towards 10 MHz, then this becomes more and more important. If the output termination is not sufficiently within the "spec", then you will get reflections back down the wiring - and this may shut down the module when it attempts to "protect itself" from your handiwork. This manifests itself in an odd way, and produces a cycling of "lock" followed by "unlock" and then back to "lock again". This will keep happening all the time that the module objects to your wiring conditions. It doesn't seem to cause any damage to the module (providing there are no short circuits) and will recover if the frequency is changed to something less than 1 MHz - or if you disconnect your wiring or loading. Only experiment will show you what you can and cannot get away with in respect of impedance termination.

    I hope this primer has been of service to beginners who would like a GPS controlled signal generator. I cannot promise to answer all queries arising either - especially as I'm a WIN PC user not a LINUX user. Maybe others can handle these type of questions.

    Have fun and enjoy your UBlox NEO M8N module - despite the pains given by the USB conversion cables ! If I'm slow to answer any queries, it will probably be because I'm away from my office for some reason. I don't use mobile devices.
    Last edited by TelephoneBill; 08-28-2017 at 02:07 AM.

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,021
    is this a question, how to, or advertisement?

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    Given the title I saw it as a how to ... or "Primer for beginners ". Thanks TelephoneBill

  4. #4
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    275
    Quote Originally Posted by tonton81 View Post
    is this a question, how to, or advertisement?
    In a number of other posts (e.g. https://forum.pjrc.com/threads/45693...uency-Standard) I have often used a GPS signal for reference on a scope. I thought many Teensy users might be interested to know exactly how this was done. Sorry if its a bit long winded, but the snags with USB/TTL conversion cables are a real nuisance.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    I forgot about this thread - got a uBlox around Christmas and immediately made a Teensy feed through proxy sketch to run u-center. Allowed full use for changing params and getting info to the u-center.

    My unit was a much more compact breakout - but it works well ... uNav-AHRS

    Attachment 12722

    This pic shows using the second teensy as a proxy to a serial port for debug output (using the same proxy code) - when connected to breadboarded Teensy's Serial the sketch at the link works to run u-Center.
    Last edited by defragster; 02-20-2018 at 07:40 PM.

  6. #6
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    Crap I was trying to edit the post and somehow I deleted it ??

    There is really no need for USB cable conversions if you have a Teensy ):
    teensy3.x can be used as bridge for serial communication.
    Just access example, in Arduino by clicking File > Examples > Teensy > USB_Serial > USBtoSerial

  7. #7
    Quote Originally Posted by Chris O. View Post
    Crap I was trying to edit the post and somehow I deleted it ??

    There is really no need for USB cable conversions if you have a Teensy ):
    teensy3.x can be used as bridge for serial communication.
    Just access example, in Arduino by clicking File > Examples > Teensy > USB_Serial > USBtoSerial
    I do something similar with my bike computer, enabling AGPS to function correctly:


    Code:
    // passthrough mode
    
    		while (buttonIsReleased(BUTTON_HW_4)){
    			if (gpsModule.available())
    				sl.write(gpsModule.read());
    		
    			if (sl.available())
    				gpsModule.write(sl.read());
    		}

  8. #8
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    215
    I don’t understand the bit about what I can do with the 1-10Mhz pulses. Please explain.

  9. #9
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    275
    The frequencies that you can generate (and are available on the orange and black wires) are very, very accurately timed. They provide a frequency standard of laboratory precision (Stratum 1). They are also aligned with UTC (taking account of cable delays etc) to within 30 nS. You can specify the output frequency to any integer from 1 Hz to 10 MHz, and you can also vary the mark/space ratio.

    What can you do with them? Well, you can check the calibration of any other electronic equipment - such as an oscilloscope, for example. Or the calibration of a radio receiver, or identify any received radio signal (from its declared frequency). You could easily check the frequency of a Teensy crystal oscillator with great precision, and adjust it plus/minus to make it more accurate (search previous posts for more details). That in turn would improve any timing you may use the Teensy timers for.

    Accurate timing, to this degree, is often used to identify events geographically. An excellent example is determining the location of where a "Lightning Discharge" is taking place (see http://www.blitzortung.org/Webpages/index.php). This is only possible because many users have a receiver permanently switched on, and they automatically identify a discharge from its characteristics and time stamp the event. They then submit these records to a central server, which knowing where/when the events were recorded can triangulate the location of each individual Lightning Strike.

    I use the frequencies to calibrate my own frequency counters and spectrum analysers. By the way, a cheap way to get your own spectrum analyser is to free down load "HDSDR" - a software defined radio - capable of accurately identifying radio emissions to better than 1 Hz. You will need to buy some hardware to go with it (you can use a sound card, but there are better devices on the market). Then you can identify transmissions from satellites passing overhead - such as the International Space Station.

    Truly accurate timing has millions of uses - particularly for Teensy enthusiasts and their associated projects.

  10. #10
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    215
    Wow. Is this phase locked satellite timing magic updated at regular intervals from satellites or is it like a live 10mhz signal with the ublox thing just passing it onto the teensy.

    So gps data is over serial or something and this signal you can use for accurate timing stuff.

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    uBlox syncs to multiple satellites and they all share the same time - that time and the differences to it { on receipt of messages from that satellite } tells the uBlox where it is relative to the satellites by having the same time.

    My uBlox had only an LED for the 1 second PPS utc sync'd - I wired that to Teensy pin. Prior Adafruit Ultimate had a pin output for that PPS.

    Others I'm working with using uBlox either don't have any access to pin not brought out - or would have to wire to a package pin if it isn't covered up like mine is.
    Last edited by defragster; 02-20-2018 at 07:33 PM.

  12. #12
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    275
    Yes, be careful if you purchase a UBlox GPS module to make sure you can access the 1PPS LED limit resistor. They are be built in all manner of housings. Defragster makes the point I had missed - the output (check before use) should be 3v3 so compatible with T3.6 input pins directly.

    I was "dreaming" recently of a Teensy "solution" which had several Teensy users with their T3.6's cpu's running phase locked around the globe - but I have yet to find the "problem" :-)

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    I only feed uBlox from 3.3V so was lucky the voltage was right to get the PPS going to the LED. This is my wire to the LED on my $20 breakout:
    Attachment 12774

    I managed that to an extra header pin - where the other pins are soldered in breakout shown on post 5 pic.

  14. #14
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    I wonder if i can do this with this super cheap 4$ GPS i got.
    Here is how my GPS looks

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    Note - my uBlox is a #8.

    Look up the pinout for the uBlox 6M. IIRC pin #3 is the PPS signal on mine - which may be feeding that LED - unless it is rotated or different - or it wasn't pin #3 as I read the spec weeks back. My uBlox has a Tx LED and the PPS LED. And there is a metal cover plate over the uBlox so I had to rely on what was brought out and have only seen pictures

    Either way if you can solder to one of those uBlox package pads - I expect you can get the PPS - even if it isn't feeding that LED.

  16. #16
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    Thanks
    Looking good just need time to play with this.
    I did look in uBlox 6M data sheets and it appears pin #1 is marked with the black dot on the label (bottom left).
    In uBlox 6M data sheets pin#3 =Timepulse (1PPS), on the picture, pin#3 is connected to the resistor and smd led.

  17. #17
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,019
    This post link to the thread where I'm using mine. A $15 NEO-8M has the PPS pin brought out to a pin, looks like the new eBay version as I saw another for $13 from Hong Kong.

  18. #18
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    It seems I can set the frequency between 1Hz to 24 MHz.
    Just curious if this is my GPS only, haven't done any scope testing yet.

    Long story short I'm trying to add support configuration command for uBlox Library UBX-CFG-TP5 (0x06 0x31)-Set Time Pulse Parameters.
    Https://forum.Pjrc.Com/threads/36103-uBlox-Library

  19. #19
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Hi Chris
    Just took a look at the receiver description, the one note that may pertain simply:
    The recommended configuration when using the UBX-TIM-TP message is to set both the measurement rate (UBX-CFG-RATE) and the time pulse frequency (UBX-CFG-TP5) to 1Hz.
    Suggest you take a look at the receiver description - looks like it is also tied to a couple of other parameters: https://www.u-blox.com/sites/default...%29_Public.pdf , this is the link in case you don't have it.

    Mike

  20. #20
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    275
    Interesting... I just tried this with my M8N and sure enough, yes, it did work up to 24 MHz. The U-center software objected when I tried 25 MHz, so this may be an update on the former 10 MHz. I also noticed that there was no appreciative clock jitter at 24 MHz, whereas there was at 10 MHz. This must be the fact that the crystal running at 48 MHz is a multiple of 24 MHz (or near enough). So probably true also at 8 MHz and 16 MHz.

    I will need to do a bit more experimenting to prove that the transitions at 24 MHz are in fact "aligned with UTC", but the software did not indicate otherwise - green power "bars". I'll also have a look at the spectrum of the harmonics of 24 MHz, just to see if these are improved. The harmonics for 10 MHz are pretty bad in the UHF region (as a result of clock jitter). I'm lucky to have a Rubidium (FE5680B) with a 30 MHz output which I calibrated to the 10e11 region, so I have an independant check.

    One thing I can see using the Ruby is the degree of random shift of the GPS signal w.r.t. UTC. Its about +/-100 nS worst case. I think this shifts as satellites come "in" and "out" of lock causing the UBlox software to jump around for a short while until it settles. You often see this as a sudden temprary "aberration" on the "map view" of your location.

  21. #21
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    I just took a look at the spec again, I think by default its aligned to GPS time, btw - its also selectable on whether you want to align it to UTC or GSP but I think it said there is a delay in UTC time. I did find this that may prevent you from going higher than 24Mhz. Never played with these settings before so this is going to be interesting.

    The maximum pulse length can't exceed the pulse period.
    Time pulse settings shall be chosen in such a way, that neither the high nor the low period of the output is less than 50 ns (except when disabling it completely), otherwise pulses can be lost

  22. #22
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    I know this is a bit confusing, but I'm not even messing with this (UBX-TIM-TP (0x0D 0x01) Time Pulse Timedata setting).
    I hope I don't have to
    This is the one I am looking into (UBX-CFG-TP5 (0x06 0x31) Time Pulse Parameters)

  23. #23
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Yea, everything I mentioned came from sections on the TP5 message. It looks like if you don't mess with anything else you may be limited, don't know enough to say positively though, to 24Mhz. From what I saw the two were linked.

    Based on TelephoneBill's comments, do you think you need to go higher than 24Mhz?

  24. #24
    Senior Member
    Join Date
    Dec 2013
    Posts
    219
    I got to admit I'm complet amateur in this field, 24Mhz sounds good enough for me .
    I'm thinking about building a cheap benchtop frequency generator based on Teensy 3.x and GPS with LCD touch-screen, that's all.

  25. #25
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Been using it for a while but never got in this deep. 24 sounds good to me too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •