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

reception & transmission of GPS data

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



Joined: 23 Jul 2006
Posts: 20

View user's profile Send private message

reception & transmission of GPS data
PostPosted: Mon May 07, 2007 9:02 am     Reply with quote

hi
I want to transmit parsed data recieved from GPS.
I am recieving at baud rate of 4800 and want to send it at 1200.
What is the best way to transmit the data.If I use transmit interrupt i.e INT_TBE,will it affect the recieve interrupt #INT_RDA.
I am using HW serial port of PIC16F877A with crystal frequency of 20MHz.
regards....
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

Re: reception & transmission of GPS data
PostPosted: Mon May 07, 2007 11:30 am     Reply with quote

ryan.reeve wrote:
hi
I want to transmit parsed data recieved from GPS.
I am recieving at baud rate of 4800 and want to send it at 1200.
What is the best way to transmit the data.If I use transmit interrupt i.e INT_TBE,will it affect the recieve interrupt #INT_RDA.
I am using HW serial port of PIC16F877A with crystal frequency of 20MHz.
regards....


no, TX side INT_TBE will not affect the RX side INT_RDA. these are separate datapaths.

since i am assuming from your question that data is received from the GPS asynchronously at 4800 to the data transmitted by the PIC at 1200, simply set up a circular buffer for RX'd bytes to be placed into with each INT_RDA. there are many hints in the forum on how to do this. whenever the pointers are unaligned, read from the buffer into an array of bytes (we can call it a string if you want).

then in turn a parsing function takes the RX'd string and generates an output string. if you do the RX side buffering correctly, and the output message is short, you can just putc() the TX string. otherwise, you have to employ TX interrupts so that you don't miss parsing an incoming GPS string.

nevertheless, ensure that you have enough time to TX everything you need to prior to another GPS string arriving. otherwise, you will be in danger of overrunning the input.

jds-pic
ryan.reeve



Joined: 23 Jul 2006
Posts: 20

View user's profile Send private message

PostPosted: Tue May 08, 2007 8:38 am     Reply with quote

I just want to transmit 6 parameters i.e.

float latitude,longitude
long heading, bearing
long altitude, speed

How can i make sure that I donot miss any character from Reception.
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Tue May 08, 2007 10:31 am     Reply with quote

GPS devices usually transmit data at a 1 sec interval as a max. rate. Depending on the sentence length you have almost a second to do the data parsing and and to resend data before the next set of GPS sentences arrive in the other port. (you can configure most GPS devices to send only the relevant data you need)
I would not worry about losing data even without interrupts in the transmit side.
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