View previous topic :: View next topic |
Author |
Message |
ryan.reeve
Joined: 23 Jul 2006 Posts: 20
|
reception & transmission of GPS data |
Posted: Mon May 07, 2007 9:02 am |
|
|
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
|
Re: reception & transmission of GPS data |
Posted: Mon May 07, 2007 11:30 am |
|
|
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
|
|
Posted: Tue May 08, 2007 8:38 am |
|
|
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
|
|
Posted: Tue May 08, 2007 10:31 am |
|
|
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. |
|
|
|