Problems getting TTL output from GPS...ideas?
Patrick Smith
Posts: 7
Just got my GPS module in the mail today. I want to send it's output to a Nikon DSLR camera. The Nikon accepts TTL serial data input. I am currently interfacing a Garmin eTrex to the camera and converting it's native RS-232 output to TTL with a MAX232 chip. The Garmin ouputs NMEA 0183 at 4800 baud and I get the GPS indicator immediately on the camera.
Reading the datasheet on the Parallax GPS, connecting the RAW pin to ground will tell it to output raw gps data in NMEA 0183 at 4800 baud on the SIO pin, obviously in TTL. That's the format the camera needs, so it *should* work - but it doesn't. I never get the GPS indicator to come on or flash, even when the GPS LED has been solid for a long time (more than 10 minutes). I'm connecting to the same pins on the camera that work with the TTL output from my current GPS setup.
I even connected to the Polstar GPS chip directly (using the datasheet on their website), bypassing the Parallax board. Still couldn't get the camera GPS indicator on, with a good fix on the chip. BUT! Using the RS232 TX pin from the Polstar, I connected it to my existing RS232>TTL circuit and got the camera input to work. Explain that!
So if anyone can offer any help or suggestions on getting TTL output direct I would appreciate it.
Thanks,
Patrick
Reading the datasheet on the Parallax GPS, connecting the RAW pin to ground will tell it to output raw gps data in NMEA 0183 at 4800 baud on the SIO pin, obviously in TTL. That's the format the camera needs, so it *should* work - but it doesn't. I never get the GPS indicator to come on or flash, even when the GPS LED has been solid for a long time (more than 10 minutes). I'm connecting to the same pins on the camera that work with the TTL output from my current GPS setup.
I even connected to the Polstar GPS chip directly (using the datasheet on their website), bypassing the Parallax board. Still couldn't get the camera GPS indicator on, with a good fix on the chip. BUT! Using the RS232 TX pin from the Polstar, I connected it to my existing RS232>TTL circuit and got the camera input to work. Explain that!
So if anyone can offer any help or suggestions on getting TTL output direct I would appreciate it.
Thanks,
Patrick
Comments
You ARE connecting the ground terminal as well, right?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Thanks,
Patrick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
-dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
This is not a sig. This is a duck. Quack.
1) From Garmin eTrex:
2) From the RS232 of the Polstar GPS board:
3) And from the TTL output of the Polstar board level shifted to RS232 ouput:
Now I'm no expert at this but the only significant difference I can see between 2 and 3 is there's one more $GPGSV sentence output from the TTL side. I also have no idea if the Nikon needs reverse polarity and don't have a scope to check. If someone knows how I can flip the TTL ouput polarity and will tell me how, I'll give that a shot. Regardless the RS232 output DOES work as long as you change the levels down to TTL. If I can't get direct TTL to work I need to find the smallest level-shift circuit out there... the MAX232 with 5 caps is a lot more bulky than I wanted.
Thanks for the help.
Patrick
Are you sure the camera can accept any/all the string types that the Polestar puts out? I would expect the camera to like the most common $GPGLL string and perhaps not accept some of the others.
You may be able to fool the camera by having a stamp "re-create" a string type the camera will accept.
Regards,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Thanks,
Patrick
Gotcha, missed that in the posts.
So, if it works with shifted RS232, using the "inverted" mode in TTL should give a readable signal. If its not possible in the setup of the GPS, feed the GPS's ttl through a transistor or inverter chip. But, now you have extra parts!
Note that the MAX 233 does the whole level shift without external caps.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Thanks,
Patrick
· You could possibly reprogram the SX on the GPS module to invert the data for you.
· Of course you would not use RAW mode then.
· The SX code would be VERY simple...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
There are only two guaranteed ways to become weathy.
Spend less than you make.
Make more than you spend.
Post Edited (Bean (Hitt Consulting)) : 9/27/2006 4:27:24 PM GMT
Just go with the transistor model to see if it will work. With a chip (74LS00, etc), you'll need +5 and 0v to the chip, but it will give you a bit better swing of voltage.
I usually use a MOSFET (IRL510 or IRL520) because the gate can be hooked directly to the stamp/ttl pin. Hook up something like this:
+5v to one end of a 470 ohm resistor
other end of resistor to Drain (or collector) of NPN transistor
Source (or emitter) of transistor to 0 volts.
Gate of Mosfet to TTL input. ( or through 1K resistor to base of NPN transistor)
Serial data is at Drain connection of mosfet with respect to 0v.
Good luck.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Patrick
I used a level shifter and sent the data to my PC serial port to take a better look.· The GPS data is fine.
The data sheet shows that I can connect the SIO pin directly to the BS2 with no additional circuitry.· So, I have 5V going to the BS2 and the GPS module, and ground is connected of course.· The voltage swing on the SIO line is only 3.0v peak to peak.· It's not obvious if this is sufficient for the BS2.· At least, it certainly appears NOT to be.· I'll try doing a read only with the Stamp using level shifted data to 5v.· I haven't gotten to try that yet.· It just seems that I shouldn't have to do this.
Should the GPS module output a signal that is 5v peak to peak?· Or is 3v peak to peak normal?· If it's normal, does this mean that my BS2 is simply defective in some way?
Any suggestions for making this work?· Bear in mind that the SIO pin does double duty as an output from the Stamp and an input to it.
Thank you,
Joel-
·
·
·· Are you using the demo code from our website?· Are you sure of the connections?· Also, what happens if you put a 4.7K (or 10K) resistor on the /RAW pin to Vdd?· Can you post a picture of your connections?· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
If you do have everything wired up correctly then you might just try using
another pin on the BS2 for your serial connection to the GPS module.
Naturally, you will need to change the BS2 demo program source code but
it's only in one place that you need to do that, line 33. I've had one or two
pins go <raspberries> on my BS2 so... just a thought.
If you had your GPS connected to your PC was it receiving a steady stream
of NMEA sentences or did you manually key in or have a program send the "!GPS"
commands? If you saw a steady stream of NMEA sentences then you'll need to
change the /RAW pin to unconnected (or tied to Vdd, as Chris suggests, with a
resistor) because the BS2 demo program can not deal with a steady stream of
data like that. Running the GPS module in Raw mode but with the BS2 demo
program would result in garbled data.
3.3V is what I normally see at the output from a TTL pin when Vcc (or Vdd in
this case) is about 5.1volts. This (and your 3v) is more than enough to signal
a logical one to any TTL system and the Basic Stamps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
Post Edited (Fe2o3Fish) : 10/7/2006 3:00:50 AM GMT
I am using the demo code from your website. I've checked the connections over, and rewired it a few times just to be sure. It's all OK. I put a 10K resistor on the /RAW pin to VDD but that made no particular change to the output signal.
While trying this a few times, power cycling in-between, I saw the peak to peak voltage change to nearly 4.5 volts for a few moments. When this happened, valid, ungarbled data was transmitted to the BS2, and I saw live, good GPS data on the debug window for the first time. Then, as quickly as it came, the amplitude changed back to 3.0v and the uncorrupted data signal was lost. :-(
I've managed to get it to work about 4 times now in the last hour. It runs for a minute or so when it works, and then drops back down to the 3.0v level and stops working again. I know it sounds weird. It's really happening. I'm just watching it on my scope as it happens.
I _can_ post a picture of my setup, but I think I'll have to clean my desk a little bit so that I don't embarass myself.
Another strange thing I noticed is that when the SIO amplitude is 3.0v peak to peak, the state of the /RAW pin has no impact on the data flow. The GPS module continues to dump data to the SIO pin regardless of whether or not the /RAW pin is tied high or not. When the peak to peak voltage is at 4.x volts (i.e. I'm getting good data), the /RAW pin functions like it's supposed to. So for example, if I just connect GPS module power + ground, and watch the SIO output on my scope, I'll see raw data pouring out, regardless of the state of the /RAW pin.
I know, it's odd. But if it were acting normally, I wouldn't have to ask.
Rusty,
For the PC experiment, I tied /RAW low so that I wouldn't have to send it any data. I connected it to a MAX233 level converter, then to the PC. Then I just watched it with HyperTerminal, and saw the correctly formatted raw strings.
Regards,
Joel-
So, the BS2 demo program gets confused because it's receiving a stream of data that it wasn't expecting. And eventually, when things work, the GPS module respects the /RAW signal and dumps data in smart mode only when the command string is received (like it is supposed to). And in this situation, the demo program works.
So, I think the problem has now been reduced to figuring out why the /RAW input is being ignored by the GPS module. And then of course, why does it intermittently work now and again? There's not a lot going on with the wiring for the /RAW signal. I've left it unconnected and I've tied it high through a 10K resistor. It's simply ignored. And as I indicated above, the /RAW signal *does* do the right thing when the SIO output happens to be a 4.x volts.
Thanks for the help so far!
Joel-
·· Please contact our Tech Support Deptartment on Monday or send an e-mail to support@parallax.com and we'll get this taken care of.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Joel-