CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Fastrax iTrax300 GPS output help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

Fastrax iTrax300 GPS output help
PostPosted: Fri Dec 03, 2010 4:30 am     Reply with quote

Hi,
I am Interfacing a Fastrax iTrax300 GPS module to PIC16F887.
I want to test the GPS module with Tera Term (or Hyper Terminal) without the PIC16F887. The GPS module (iTrax300) have 9 pins as follow:

Pin1 = VCC
Pin2 = GND
Pin3 = NC (Not used)
Pin4 = TXD1
Pin5 = RXD1
Pin6 = IPPS
Pin7 = WAKEUP
Pin8 = SX1
Pin9 = RX1

My connection is as follow :

Pin1 & pin2 to my 5v dc power
Pin9 (rx1) of the gps to pin3 (txd) of my pc serial port (db9)
Pin8 (sx1) of gps to pin2 (rxd) of pc serial port (db9)
Pin5 of serial port db9 to ground of my 5v dc power and pin2 of the gps receiver.

My terminal setting are as follow:

Port = com1
Baud rate = 4800
Data = 8 bit
Parity = none
Stop = 1 bit
Flow control = none

The result at terminal window is as follow :
Quote:

nNNÖNN"nNN"nNN:"n>>NãRr¹99YNN"nNN"nNN:"n>>&NãRr¹99YNN"nNN"n
NN:"n>>&NRr¹99YNN"nNN"nNN:"n>>>NRr¹99YNN"nNN"nN:NÊn>>N>"*Nn
NNÖNN"nNN"nN:NÊn>>:NËRr¹99YNNnNN"nN:NÊn>>"NãRr¹99YNN"nNN:nN
:NÊn>>N|"*NnNNÖNN"nNN"nN:NÊn>>*N>"&NnNNÖNN"nNN"nN:NÊn>>.N>
"&NnNNÖNN"nNN"nN:NÊn>>"Nã2r¹99YNN"nNN"nN:NÊn>>>N?

Please, I don't understand this output from the terminal window. Or am I doing something wrong ?

My aim was to use the output from the GPS to track position of an object like longitude, latitude, etc, and display it on lcd using 16f887 but I can't decode the output.

I need help pls.

Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 4:53 am     Reply with quote

Your connections are wrong.

From the data sheet:
"I/O levels form the serial ports are CMOS compatible, not RS232 compatible. Use an external level converter to provide RS232 levels when needed."

You need a chip like the MAX232 between the GPS, and the PC.

The unit is designed to talk directly to things like the PIC, but to talk to the PC, requires this extra interface chip....

(the typo, 'form', rather than 'from', is in the data sheet)...

Best Wishes
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 7:10 am     Reply with quote

@Ttelmah

Thanks for your quick reply.

I think that SX1 and RX1 (pins 8 & 9) can communicate directly without max232. And that I only need max232 if am using TXD1 and RXD1 pins (pins 4 & 5) for serial comm.

Quote:
From the data sheet:
"I/O levels form the serial ports are CMOS compatible, not RS232 compatible. Use an external level converter to provide RS232 levels when needed."


Which datasheet ? Because I have a lot of them here.
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 7:12 am     Reply with quote

Pls if you have any sample schematic for the connection, I will appreciate.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 8:16 am     Reply with quote

Seriously, almost none of this type of module will include the MAX232. They are built for embedded applications, so produce TTL, or CMOS serial, just as the PIC does.
Now the data sheet I am referring to, is the 'Technical description' sheet, which says:
"This document describes the electrical connectivity and main functionality of the iTrax300 hardware.".

Section 4.9, _referring to both UARTS_, says:

"4.9 UART
The device supports UART communication via Port A and Port B. With the standard firmware the Port A is configured by default to NMEA protocol with 4800 baud and Port B to SiRF binary at 57600 baud. The Port A is used also when the device is booting from the se- rial port.
The default configuration for Ports and respective protocols can be changed by commands via NMEA or SiRF binary protocols (ref II & III). Any custom configuration stays active as long as the back up sup- ply VDD_B is active.
NOTE
Antenna bias current from VDD supply should be limited externally to 150 mA max.
For users who want to switch between NMEA and SiRF binary protocols with Fas- trax default firmware configuration (see chapter 3.2.1), the usage of the Port B is suggested.
Since the SiRF firmware does not support the same protocol existing on both ports A and B, the user must first disable the Port A NMEA protocol by sending binary message ID 165 (Set UART Configuration) on port B and setting the Port A to ‘no protocol’ (In- put/Output protocol parameter 05h for port 0), see ref III.
Port B can be then configured to or switched between NMEA and binary protocol.
2006-12-18 Page 20 of 35 iTrax300_Tech_doc_13
I/O levels form the serial ports are CMOS compatible, not RS232 compatible. Use an external level converter to provide RS232 levels when needed."

Definately says you need the MAX232 or equivalent...

Best Wishes
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 9:58 am     Reply with quote

The problem SOLVED.

The GPS module i was using have max232, So i traced the circuit and use the right pins (TXD1/RXD1) instead of pins (SX1/RX1). TXD1/RXD1 are input to max232 while SX1/RX1 are output from max232.
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 10:10 am     Reply with quote

This is the output from GPS.


Code:

$GPGSV,3,1,12,19,59,155,28,03,25,155,31,06,13,150,14,23,61,203,26*760*6DGSV,3,1,12,19,61,153,25,03,27,155,32,06,16,149,3
$GPGGA,155752.0
$GPGSV,3,2,12,11,51,359,14,24,44,030,19,20,41,324,17,32,38,003,17*73
$GPGSV,
$GPGSV,3,1,12,19,59,154,29,03,26,15
$GPGGA,155620.0
$GPGSA,
$GPGSV,3,3,12,13,27,206,,31,11,081,16,28,08,280,,17,02,323,16*7CGSV,3,1,12,19,59,155,24,03,25,155,26,06,13,150,21,23,61,203,21*7
$GPRMC,155841.074,V,,,,,,,031210,,,N*43M,22.9,M,,0000*650,,,
$GPGSV,
$GPGSV,3,
$GPGGA,155842.074,,,,,0,00,,,M,0.0,M,,0000*5A,38,003,14*7A,1,03,06,19,,,,,,,,,,,,*1343,E,0
$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,
$GPGSV,3,3,12,13,27,
$GPGSV,3,1,12,19,59,155,28,03,25,155,31,06,13,150,14,23,61,203,26*76,,,,,,*13
$GPGSV,3,2,11,11,48,355,1
$GP
$GPRMC,155752.074,V,1030.321
$GPGSV,3,2,12,11,51,359,14,24,44,030,19,20,41,324,17,32,38,003,16*7224,03,27,155,32,06,16,1
$GPGGA,155753.074,1030.3425,N,00725.4925,E,0
$GPGSV,3,3,12,13,27,206,,31,11,081,16,28,08,280,,17,02,323,1 


I can now think of how to use my 16f887 to decode the message
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Fri Dec 03, 2010 1:37 pm     Reply with quote

So you have a board that contains the ITrak300, rather than the module itself.
Remember the PIC will want to connect to the CMOS signals, not the RS232 signals.
If you do a search here, you will find a lot about decoding the NMEA packets.

Best Wishes
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Sat Dec 04, 2010 3:39 am     Reply with quote

Quote:

So you have a board that contains the ITrak300, rather than the module itself.

Yes Ttelmah, I thought that the whole board was the GPS module. I was even searching for the description of the pins RX1 and SX1 on net, not knowing that those pins are not part of the GPS chip. I even asked the GPS
manufacturer (FASTRAX) about the issue yesterday, they also told me that I will use RS232 converter.
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Sat Dec 04, 2010 3:49 am     Reply with quote

Quote:

Remember the PIC will want to connect to the CMOS signals, not the RS232 signals.

Yes i know, i will connect PIC to pins RX1 and SX1 because those pins are outputs from max232 (pins 9 & 10 - R2out & T2in). I hope i can use null modem here.
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Mon Dec 06, 2010 5:33 am     Reply with quote

HELLO
Another issue...
Pls how can i make the PIC16F887 to communicate with baud rate of
4800. The GPS modem works with baudrate of 4800
But if i use that(4800) for 16F887's code it will not work
if i change 4800 to 9600, the LCD will display HELLO WORLD and it will not communicate with GPS because GPS baud rate is 4800

My test code is to display HELLO WORLD in 16x2 LCD (with baud rate of
4800 and GPS receiver is not connected yet).

Here is the sample code:
Code:

#include "gps.h"
#include <string.h>
#include "flex_lcd.c"

//char cmd[10] = "$GPGGA";
//char str[50]; //string to hold data from gps module
//char* ptr;

void main()
{
      lcd_init();
      lcd_putc("HELLO WORLD");
}



And here is my header file (gps.h)

Code:

#include <16F887.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES XT                           //XTAL Osc
#FUSES NOPUT                     //No Power Up Timer
#FUSES NOPROTECT             //Code not protected from reading
#FUSES NODEBUG                //No Debug mode for ICD
#FUSES NOBROWNOUT          //No brownout reset
#FUSES NOLVP                    //No low voltage prgming
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected

#use delay(clock=4000000)
#use rs232(baud=4800,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors)
[/b]
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Mon Dec 06, 2010 7:40 am     Reply with quote

Hi,

The COM parameters for external devices like the (GPS module) should not affect your ability to write to the LCD using the Flex_LCD driver. Here is PCM's test code for his driver. Modify it for your PIC chip and report back what you find. Note a couple of things:

1. There is no #use rs232 directive
2. There is a While(1); endless loop at the end of Main. Don't leave this out!

Code:

#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)

#include "flex_lcd.c"
   
//==========================
void main()
{
lcd_init();  // Always call this first.

lcd_putc("\fHello World\n");
lcd_putc("Line Number 2");

while(1);
}


Spend a lot of time reading the forum, and do a search for terms like 'NMEA'. You'll find that GPS reception issues have been covered countless times!

John
princejude



Joined: 07 Aug 2010
Posts: 72

View user's profile Send private message

PostPosted: Thu Dec 09, 2010 5:07 am     Reply with quote

ezflyr/John

Quote:

The COM parameters for external devices like the (GPS module) should not affect your ability to write to the LCD using the Flex_LCD driver. Here is PCM's test code for his driver.

I have used Flex_lcd driver several time. I don't have problem with it. The issue is about the baud rate. If i use 9600 it will work but if i use 4800 it will not work.The GPS receiver's baudrate is 4800 . My crystal is 4MHz.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Fri Dec 10, 2010 9:28 am     Reply with quote

Hi Again,

Sorry, but it's not clear to me what your problem is? As I said, your ability to send data to the LCD is not dependent on any COM parameters you might use to communicate with your serial GPS.

Did you try PCM's flex_lcd test program?

You say "The issue is about the baud rate. If I use 9600 it will work but if I use 4800 it will not work." In this sentence, what does the word "it" refer to? Do you mean the GPS, or the LCD?

I understand that your GPS module communicates at 4800 baud - I got that! Obviously, then, you want the PIC to communicate with the GPS at 4800 baud. But, if you were to re-configure your GPS for 9600 baud, you should also be able to communicate with the PIC at 9600 baud. My point is that the PIC baud rate must match the baud rate of the GPS module, but that selection is completely independent of the functionality of the LCD.

John
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Dec 10, 2010 9:48 am     Reply with quote

Don't forget to change the original post Subject to include something like (SOLVED) so people know you figured it out -- it helps everyone.


Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group