bansinickname
Posts: 4
Joined: Tue Apr 19, 2016 5:08 am

GPS Module Interfacing not on UART

Tue Apr 19, 2016 5:13 am

I have started using Raspberry Pi a few time ago, its interesting to use. I have some questions

1. I need to know GPS modules which I can interface with Raspberry Pi on I2C or SPI interface because my UART is busy

2. I studies a lot and found that I2C interface is slow but battery saver and SPI is fast, how does it help me decide GPS module

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: GPS Module Interfacing not on UART

Tue Apr 19, 2016 6:56 pm

would it be a way to interface the Pi to an Arduino Due (!) by i2c and attach the GPS module to Arduino-UART?

I did that already on another platform (EV3 - Arduino - GPS): http://www.mindstormsforum.de/viewtopic ... 673#p67709

about speed: it's not an issue.
1st, UART runs at 115200 baud, and i2c at 100kHz, which is almost the same,
OTOH GPS signals are updated just a couple of times each second.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPS Module Interfacing not on UART

Tue Apr 19, 2016 7:13 pm

You can receive serial data on arbitrary GPIO using bit banging. There shouldn't be any problem handling typical GPS speeds of 4800 bps.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: GPS Module Interfacing not on UART

Tue Apr 19, 2016 7:40 pm

for that purpose a handy and convenient lib like Arduino's SoftwareSerial Library would be very helpful!
https://www.arduino.cc/en/Reference/softwareSerial
https://www.arduino.cc/en/Tutorial/Soft ... ialExample
:geek:
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
Douglas6
Posts: 4860
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: GPS Module Interfacing not on UART

Tue Apr 19, 2016 7:49 pm

Or, add a cheap Bluetooth module and a battery to the GPS. Gives you some flexibility in placement.

[EDIT: viewtopic.php?p=734870#p734870]
Last edited by Douglas6 on Tue Apr 19, 2016 7:54 pm, edited 2 times in total.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: GPS Module Interfacing not on UART

Tue Apr 19, 2016 7:52 pm

#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

bansinickname
Posts: 4
Joined: Tue Apr 19, 2016 5:08 am

Re: GPS Module Interfacing not on UART

Tue Apr 26, 2016 10:53 am

Thanks for all the replies but my question was not exactly answered.

If I am not implemeting GPS Module on UART, neither USB too then I have been left with SPI & I2C Interface

So please help with I2C and SPI GPS solutions

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: GPS Module Interfacing not on UART

Tue Apr 26, 2016 11:04 am

I have searched a long time for i2c for another MCU platform and found nothing, the reason might be the specific GPS data transmission protocol which is serial (UART).
So interfacing a UART GPS device to an Arduino and then interfacing the Arduino to the Pi by I2c (as I already suggested above) would be the only way AFAIK.
(CMIIW)
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Return to “C/C++”