Quote:
Originally Posted by Peter Randall
We are trying to add a Parallax GPS to a standard FRC controller using Easy C. We can see that we have established a fix via the idiot light on the GPS, but we are having trouble writing and reading the TTL serial port. Can anyone provide words of wisdom on how to write text strings to the serial port e.g "!GPS05" and how to read the serial response.
|
There are several different serial port libraries out there, so look through the documentation/header files for the one you are using. Generally you can write to the TTL serial port using printf or fprintf. Some libraries present the 2nd port as "stderr". Others will have a global variable you change to set which port the stdout (i.e. normal printf) goes to.
Is the TTL serial port enabled? The header file for your serial library might have some #define statement you'll need to change.
What baud rate are you using? Again, hopefully you can set this via a #define in the header file. What baud rate does your GPS expect?
If you're up for it, you might try connecting your TTL serial port on the controller to the serial port on your computer, so you can more easily see whether or not anything is being sent out. In order to do this, however, you will need a "ttl converter chip" (I don't think that's quite the right name for it, but I'm drawing a blank on the proper name). You could potentially use the one provided for use with the CMUCam. This will require a little extra wiring on your part to make it work, but it could be done.
I know these answers are vague, but hopefully they help a little. Keep us all up to date on your progress.