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 support@ccsinfo.com

Please Can You Help, Code GPS Parallax and PIC 16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
gustavo



Joined: 01 Oct 2003
Posts: 4
Location: estudiante

View user's profile Send private message

Please Can You Help, Code GPS Parallax and PIC 16F877
PostPosted: Thu Jun 09, 2011 4:39 pm     Reply with quote

Receive a warm greeting, my name Gustavo Mtz, student in Mexico. The reason is the request most attentive yours assistance. I need to make a GPS project for detecting characters. The module Parallax GPS Receiver 28146 module, this already transmitting the full NMEC date through a single pin C1, and you want to send them to the computer using a PIC 16F877, via the rs232 Protocol. The capture of the data from the GPS network is the C1 pin. This is a code that still testing but I get nothing.
Code:

#include <16F877.h>
#fuses HS,NOWDT,PUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=4800, rcv=PIN_C1) //can use any pin to read from GPS, but define it here
#include "flex_lcd.c" //included to allow easy writing to a parallel LCD display

char letter[300];
int go = 0,wait = 0,commacount = 0,dataoutput = 1,j = 0;
int16 i;
int16 comma[90];

void main()
{
lcd_init();

while(TRUE)
{
  for (wait=0;wait<20 //for loop used to wait until signal has reset. 20*50us=1ms>two bytes of ones at 4800 baud
  {
    if (input(PIN_C1)==1)
    {
     wait++;
    }
    else if (input(pin_c1)==0)
    {
     wait = 0;
    }

   delay_us(50);
  }

  for(i=0;i<300;i++) //record 300 characters into letter matrix
  {
   letter[i]= getc();
  }

  for(i=0;i<300;i++) //parse matrix for commas (ascii=44 for a comma)
  {
    if (letter[i] == 44)
    {
     comma[commacount] = i;
     commacount++;
    }
  }
 
  go = 0; //reset testing variables back to zero
  commacount=0;

I would like to ask for this help, if I could be provided some C code for Program for capturing the data from the gps Parallax to transmition by rs232.

I would appreciate your help with some kind of program, and I find to their orders in the mailbox.

gamartinezch@Yahoo.com
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Jun 09, 2011 9:10 pm     Reply with quote

Gustavo,

I think that this project it is not the best choice to be your first experience in C and as stated, nobody will write
code for you. The reason? we are not so bad boys... we believe that first, you should start learning from the basics,
and then you will try a project like this.

I strongly suggest you to read the PIC16F877 Datasheet, regarding its hardware capabilities, internal modules
architecture and its features, pins multifunction options... and so on.

Regarding the CCS compiler, you should learn the built in functions that will help you to learn to write concise and
efficient code to do what you want.

Read the CCS Compiler Reference Manuals
http://www.ccsinfo.com/downloads.php

Regarding how to do your project, read in this forum how have been done and mainly its coding similar stuff.
I suggest to read the threads with the following words as a tips to search: "kbhit", "circular buffer", "buffer size",
"INT_RDA", "interrupts", etc.

regards,

Humberto
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Jun 10, 2011 5:46 am     Reply with quote

I would start out with the PIC datasheet and my hardware schematic, and decide what pins are going to talk to the GPS and which pins to the PC.

Next I would try sending a simple message, like "Hello World" to the PC. Once you have done this you can send debug messages to the PC too.

Next I would read a short bit, maybe 10 characters, from the GPS and repeat them to the PC.

Only then would I try to parse the GPS data and make sense of it.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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