Using GPS for PIC timing

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I would like to know more about GPS timing.

Can 2x separate GPS modules be synced accurately. 'Say' 1 mile to1000s of miles.

The ones I use 'Ublox' give a 1second LED and approx 200ms NMEA messages, and the way I READ them on my project is random, where I 'see' 3x messages/s
Camerart.
 

Georg_B

Joined Apr 18, 2022
16
Hello!

There must be a problem in you code. I've used lot of uBlox modules, none of them sent the NMEA messages two/three times in one second (by default settings).

If you're using the same read method, the two modules can be synced. Check for cicular buffer and UART Receive interrupt.

edit:
Distance soesn't matter. The satellites (in same family) sending the same time all over the world.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hello!

There must be a problem in you code. I've used lot of uBlox modules, none of them sent the NMEA messages two/three times in one second (by default settings).

If you're using the same read method, the two modules can be synced. Check for cicular buffer and UART Receive interrupt.

edit:
Distance soesn't matter. The satellites (in same family) sending the same time all over the world.
Hi G,
I agree, the Ublox M8N GPS sends messages at 1/sec by default. I've set them to update 5x/sec, which is (I think) as fast as they can go with accuracy. The CODE tres to READ them as often as possible at random times, and at the moment is catching them at approx 3x/sec.

Re syncing: I'm going to do some testing, to see what happens. If SYNC is used the BASE and REMOTE will be separate, so not in contact GPS wise, just synced, so they TX an RX at the correct time. If this is possible, then this may be the best way?
It's interesting how GPS works, and that they are in sync around the world.
Thanks, C.
 

Georg_B

Joined Apr 18, 2022
16
The CODE tres to READ them as often as possible at random times
Here is the problem. Well, my english is not as good as i want, i can't write long and good explanation how to do it but check for circular buffers and UART interrupt. The interrupt will catch every bytes and if you scan the circular buffer after every bytes, you can create a sync signal. For this, make the µC clock faster to make sure, you can scan the circular buffer between the bytes. With 9600 Baud, you have around 1 ms between two bytes. Far enough for a small, 8 bit PIC with 32 MHz clock.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Here is the problem. Well, my english is not as good as i want, i can't write long and good explanation how to do it but check for circular buffers and UART interrupt. The interrupt will catch every bytes and if you scan the circular buffer after every bytes, you can create a sync signal. For this, make the µC clock faster to make sure, you can scan the circular buffer between the bytes. With 9600 Baud, you have around 1 ms between two bytes. Far enough for a small, 8 bit PIC with 32 MHz clock.
Hi G,
Your English is fine :)
I'll look into 'circular buffers' and see if it can fit into the program.
My programming is not as good as I want, and I rely on others for help with ideas like this.
Thanks.
C.
 
Top