Author Topic: Garmin GPS 18 Serial Port Connection And Code  (Read 29133 times)

mfb817

  • Member
  • ***
  • Posts: 5
Garmin GPS 18 Serial Port Connection And Code
« on: May 19, 2012, 04:19:06 pm »
A Garmin GPS 18 LVC provides serial NEMA GPS data and a very accurate 1 pulse per second timing signal ( 0- 5V for 100 mS).

To use this GPS with VB.net 2010 and a DB9 connector with minimum time delay, which pin should I connect the 1 PPS signal to?

Can this timing signal fire a VB event? Is there any similar example code available?

Thanks
Mike Black

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #1 on: May 21, 2012, 12:15:18 am »
If the PC needs to do something once/second, create a timer in VB rather than trying to read the GPS's signal in real time.

Jan


mfb817

  • Member
  • ***
  • Posts: 5
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #2 on: May 21, 2012, 07:29:08 am »
The 1 PPS is a very precise timing signal. Many widely separated computers can each use this signal from their own GPS unit and know they are in time sync.

The VB timers and stopwatches are very good but this is better and allows the syncronization.

After each pulse, the most recent GPS NEMA location/time data follows. It tells you where you were at the time of the last pulse.

But I need a better way to fire an event on the 1 PPS edge change,

My interface is a DB9 connector to a serial to usb interface now. I have a USB DAC watching the 1 PPS.

Any suggestions would be appreciated.

Thanks

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #3 on: May 21, 2012, 11:53:26 am »
Getting the GPS pulse into an application on a PC in real time will be difficult depending on how much delay you can tolerate.

For example, you could interface the signal to the serial port's CTS input and use the SerialPort.PinChanged event, but the event won't be anywhere near real time.

What are you trying to accomplish with the timing signal?

Jan

mfb817

  • Member
  • ***
  • Posts: 5
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #4 on: May 21, 2012, 02:32:01 pm »
I race a Corvette in Open Road  races. The object is to hit an exact time for the race course. Cars go off one minute apart on a 59 mile mountainous highway course. The starting time is always on a GPS second. Then there is a second restart for the return leg.

I have a lot of computer aided naviagtion equipment in the car, but getting my clocks started when the timing light turns green has been a problem. I averaged 140 mph for the course with a time error 0f 202 mS. This was only good enough for forth place. I blinked when the starting light changed.

I am trying to take advantage of using the GPS 1 PPS to reduce the effects of reaction time on the overall timing accuracy.

BTW I have most of your books. They are one of the best references I have.

Mike Black

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #5 on: May 22, 2012, 10:31:56 am »
The bottom line is that conventional PCs aren't real-time systems so it's generally not feasible to do I/O with precise timing.

Are GPS seconds synchronized with the NIST Internet Time Service? If so, that might be a route to investigate.

I'm glad to hear you like my books!

Jan

mfb817

  • Member
  • ***
  • Posts: 5
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #6 on: May 22, 2012, 05:45:50 pm »
USB ADC's seem to have a 20-30 mS ambiguity with the 1 PPS edge. This is probably the best I am going to do with a PC and COTS equipment.

Do you have any experience with the time delay/time ambiguity I might expect using the CTS pin and the SerialPortChangeEvent ?

Mike Black

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #7 on: May 22, 2012, 09:33:30 pm »
Serial port CTS is likely slower than the ADC.

Jan

mfb817

  • Member
  • ***
  • Posts: 5
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #8 on: May 23, 2012, 03:56:04 pm »
Thank you

Mike Black

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Garmin GPS 18 Serial Port Connection And Code
« Reply #9 on: May 23, 2012, 04:10:54 pm »
Some links here that might be helpful:

http://www.folding-hyperspace.com/program_tips.htm

Jan