I2C GPS

Post Reply
CANSATTUBERLIN
Posts: 5
Joined: Mon Jul 06, 2015 2:49 pm

I2C GPS

Post by CANSATTUBERLIN »

Hello Everyone,

we are developing a small quadcopter in a student project. We are using the Nanowii as our FCC. However we are struggling with the integration of an I2C module in our system.
While the I2C Module is sending data as it should the FCC does not recognize any of this data. We have basically tried every possible config.h configuration for I2C Modules to no effect.

We are using the Arexx I²C GPS JM3-GPS as our GPS module. When we activate the I2C GPS in the config.h the Multiwiiconfig GUI just counts a huge number of I2C-Errors.
Any and every suggestion on how to make this work would be appreciated.

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: I2C GPS

Post by QuadBow »

Just define I2C_GPS in config.h and adapt I2C_GPS_ADDRESS in gps.cpp to the I2C address of your GPS module.

CANSATTUBERLIN
Posts: 5
Joined: Mon Jul 06, 2015 2:49 pm

Re: I2C GPS

Post by CANSATTUBERLIN »

Thank you for the suggestions, sadly this did not suffice to solve our problem.
Our config.h looks like this (minus the comments):
...
#define NMEA
#define I2C_GPS

#define GPS_LED_INDICATOR

#define NAV_CONTROLS_HEADING true
#define NAV_TAIL_FIRST false
#define NAV_SET_TAKEOFF_HEADING true

#define MAG_DECLINATION 0.0f
#define GPS_LEAD_FILTER

#define GPS_WP_RADIUS 200
#define NAV_SLEW_RATE 30
...

We tried both of the following adresses (the code for this is actually located in the def.h)
...
#define I2C_GPS_ADDRESS 0xC8
and
#define I2C_GPS_ADDRESS 0x20
...

as in the documentation of our I2C module the "default slave address" is 0xC8 and the external address is 0x20 and we weren't sure on which one is the address that the Multiwii needs.
(One thing that we noticed is a comment after the definition of the I2C_GPS_ADDRESS, it says "7 bits" and to display 0xC8 we need 8 Bits this might be a reason for our problems.)

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: I2C GPS

Post by QuadBow »

Well, I looked into the specifications of the Arexx i2c Gps module http://www.produktinfo.conrad.com/datenblaetter/1000000-1099999/001082385-an-01-en-AREXX_I2C_GPS_EMPFAENGER_FUER_ROBOTER.pdf and found out, that it is not compatible with the i2c_gps_nav https://code.google.com/p/i2c-gps-nav/source/browse/trunk/I2C_GPS_NAV/registers.h which has been implemented in multiwii, since both store their data into different registers.
Thus, even if you found out the right i2c address, it would not help so much... By the way: it really should be 0xC8 due to the specs.

So, there are two solutions:
1. Buy a cheap serial gps device plus an i2c_gps_module. But, it would be a pity to skip your gps device.
2. Alternatively, you can adapt the code of the i2c section of the file gps.cpp to the registers of your gps device.

CANSATTUBERLIN
Posts: 5
Joined: Mon Jul 06, 2015 2:49 pm

Re: I2C GPS

Post by CANSATTUBERLIN »

Darn, but thanks for your help so far! :)
Adapting the GPS.cpp does seem feasible, so that's the way to go.

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: I2C GPS

Post by QuadBow »

CANSATTUBERLIN wrote:Adapting the GPS.cpp does seem feasible, so that's the way to go.
I assume your nick name refers to the Technical University of Berlin. In this case I am pretty sure you will manage it ;)

elaerico
Posts: 7
Joined: Sun May 18, 2014 6:45 pm

Re: I2C GPS

Post by elaerico »

Hi. I bought an ublox neo 6m gps module. It has an i2c interface.
I was thinking in making an 328 interface with the i2c-nav code, but perhaps I dont need it.
Do you know if it cam be used directly, without other microcontroller?
Thanks!

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: I2C GPS

Post by QuadBow »

elaerico wrote:Hi. I bought an ublox neo 6m gps module. It has an i2c interface.
Are you sure? I doubt, since I only see neo 6m devices with serial interface. Even if u-center offers an i2c interface it does not mean that the hardware supports i2c, too.

Post Reply