Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to I²C)

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to I²C)

Post by Tommie »

Hello,

I just finished integrating the code to access the Tiny-GPS (https://github.com/wertarbyte/tiny-gps/) module via I2C.
Tiny-GPS is a firmware for the ATTiny2313 microcontroller which turns it into an I²C-GPS device - reading NMEA data from a serial GPS receiver, interpreting it and passing it to its I²C master.
The data is pulled over in a comfortable struct, allowing easy access to all relevant data fields.
It's probably the cheapest way to connect an old GPS receiver to your copter: most USB receivers are in fact serial receivers with an integrated Serial2USB chip (pl2302 or FTDI), so if you have one lying aroud, try prying it open. You can get ATTiny 2313 controllers for 1€, and you can program them using either an ISP programming module or by using your regular Arduino device.

Here are my changes to the multiwii firmware: https://github.com/wertarbyte/multiwii- ... ts/tinygps

Feel free to merge, patch and give feedback.

Image
Last edited by Tommie on Mon May 07, 2012 7:13 am, edited 4 times in total.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Tiny-GPS successfully integrated into Multiwii

Post by copterrichie »

Very Nice.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

I'm currently trying to attach additional sensors (sonar & optical) to the ATTiny, so the ATMega can poll those via I²C without sacrificing more io pins.

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Hi mate,

Do you have any more details on how you connected ATTiny etc - resistors etc?

Cheers

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

It's extremely easy, you only need to provide VCC (pin 20) and GND (10) to the tiny - and of course add an 100nF ceramic capacitor between the power lines. Your ATTiny is now up and running, all that is left is connecting the communication lines:
* Wire SCL (pin 19) to your I²C-SCL line and DI (pin 17) to SDA.
* Connect the TX line auf your GPS device to the RX pin of the ATTiny (pin 2)

Make sure to clock your controller at 8 MHz and watch the voltages: running the controller at 5V works fine, even if the GPS or the I²C uses 3,3V.
You are done :-) Enjoy your NMEA data brought to you by your I²C bus.

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Couldnt be simpler - many thanks.

Iain

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Hi,

Checked the code. I downloaded the updates from your site, but i`m getting the following error when i enable #define gps_tiny.

I2c_read_to_buf was not declared in this scope.

Many thanks

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

refractions wrote:Checked the code. I downloaded the updates from your site, but i`m getting the following error when i enable #define gps_tiny.

I2c_read_to_buf was not declared in this scope.

Mae sure you applied _all_ the patches inside the branch; my tinygps code is build on top of some i2c refactorings (which introduce the above function).

Since merging is a PITA with svn, my advice is to

a) use git to clone my repository
b) download the tar archive of the sources from github: https://github.com/wertarbyte/multiwii- ... ll/tinygps

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Brilliant - Job done. Compiled no problems.

Many thanks

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

refractions wrote:Brilliant - Job done. Compiled no problems.

Did you assemble the ATTiny already?

Please note that my branch already includes some major changes to the I²C framework, so if you add additional sensor patches there, you might have to change addresses (https://github.com/wertarbyte/multiwii- ... 0bae2c85f2)

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

As a sidenote for those lacking an ISP programmer: Here are a few tutorials that use an existing Arduino as AVR flash device, so you can program the secondary microcontroller with your existing device:

http://hlt.media.mit.edu/?p=1695
https://www.youtube.com/watch?v=3joqP07Qo-g

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Havent got a Attiny2313 at the moment - one bought on ebay last night.

Forgot to mention. I found a typo in the gps.pde file.

The following line:

if (memcmp(&nmea, &nmea_new, sizeof(&nmea)) != 0 && i2c_errors == i2c_errors_count) {

Should be:

if (memcmp(&nmea, &nmea_new, sizeof(&nmea)) != 0 && i2c_errors == i2c_errors_count) {

"sizeof((&nmea))" instead of "sizeof((*nmea))"

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

refractions wrote:if (memcmp(&nmea, &nmea_new, sizeof(&nmea)) != 0 && i2c_errors == i2c_errors_count) {

"sizeof((&nmea))" instead of "sizeof((*nmea))"


Actually, it's just plain "sizeof(nmea)" - sizeof(&nmea) yields the size of the pointer, not the struct, sizeof(*nmea) is meaningless since nmea is not an array anymore. But thanks for the hint, I forgot to push that change to github repository, it's fixed now.

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Cheers for that.

Just noticed that i pasted the same line twice :)

Iain

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Hi Tommie,

Just got another serial gps module. Is the only place I change the baud rate in the config.h file in the tiny_gps code for the make file? Max baud rate for this gps is 4800.

Cheers

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

Changing the line there should be sufficient.

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Job done. Many thanks again :)

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

So it's working? :-)

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS successfully integrated into Multiwii

Post by refractions »

Working a treat. Take a while for the GPS to get a fix, but that`s the GPS not anything else.

Many thanks for this. Well happy. Just waiting for weather now to go and test functions.

Iain

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS successfully integrated into Multiwii

Post by Tommie »

OK, Sonar i basically working, however I wasn't able to fit this first version into a 2313 and I'm now using a 4313, but I'll try to shrink the code again. EDIT: OK, it worked, should be usable with 2313 again :-)

You can connect your HC04 sonar to the controller and receive both GPS and Sonar data via I²C, I'm going to publish the necessary patches later this day.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Tiny-GPS integrated into Multiwii (GPS and Sonar to I²C)

Post by copterrichie »

What is the possibly of adapting the code for a ATmega168?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS and Sonar to I²C)

Post by Tommie »

I'm working on it, I'll have to rework the I²C part since the ATMega devices have hardware TWI interfaces, while ATTiny controllers only bring their generic USI into battle.

But in the meantime, simply grab yourself an ATTiny2313 (or better 4313), they are cheaper and smaller than the ATMegas and require less wiring :-)

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Tiny-GPS integrated into Multiwii (GPS and Sonar to I²C)

Post by copterrichie »

Thank you.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Yesterday I added support for the A5005 optical sensor to TinyGPS, so you can now attach GPS, sonar and optical slow sensor to the sub-controller and query them all using a single I²C call.
It's still barely fitting into a Tiny2313 :-)

rudebo80
Posts: 2
Joined: Tue Oct 18, 2011 8:09 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by rudebo80 »

hi,
Can you provide me a picture how to connecting attiny2313 + sonar sensor + gps please? are HC-SR04 ultrasonic module supported with your code?
thanks

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Yes, I am using the same Sonar device (HC-SR04), but at the moment I'm having some trouble using a Tiny2313 with multiple sensors, looks like I have to cut down on SRAM use. If you can get a Tiny4313, it's probably the safer choice.

Later today, I'll push the current source code to github, along with wiring instructions

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

OK, looks like it is finally working - at least Sonar and GPS can be handled by a 2313, optical sensors are still highly experimental and untested. I also added some wiring instructions to the README: https://github.com/wertarbyte/tiny-gps/ ... ter/README

refractions
Posts: 92
Joined: Thu Dec 01, 2011 8:55 pm
Location: Scotter, Lincolnshire, UK

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by refractions »

This is fantastic work mate. This needs to be added to the next dev release.

Iain

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by dr.tom »

great work :)

I have a question,
what is the simplest way to program attiny2313 ?

I have usb AVR ISP that I used for flashing KK-s and ESC-s, but I used avrdude and only 1 .hex file that i uploaded to the chip via command line,
(already made the header for connecting it to attiny2313, but can't figure out the file for flashing)

and have FTDI for mwc, but i guess it cannot be connected directly to attiny...
or there is going to be a promini version soon? (have one in reserve also just in case)

Image



so if you could please describe the procedure, it would help much to us unexperienced members.

(going to use 2313 for HC-SR04 sonar only, already have i2c gps connected to mwc,
I have succesfully connected sonar directly to mwc over D8&D12 with code from this forum, it works,
but then it is not possible to use aux2, which is needed for gps rth and pos hold..)

Thank you :)
Last edited by dr.tom on Thu May 10, 2012 7:40 pm, edited 1 time in total.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Just download the source code, make your adjustments to config.h and compile the Code using "make". You can then upload the generated .hex file using avrdude. Don't forget to set the fuses so that the ATTiny2313 runs at 8MHz.

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

Fantastic. I have a serial GPS here and I was waiting for something like this. Can't wait to experiment it.
This one http://www.sparkfun.com/products/465

I am wondering... do you think it would be possible to add an analog sonar, like the parallax ping?
http://www.parallax.com/tabid/768/Produ ... fault.aspx

I am going to report as soon as possible my progress with the gps.
Thanks

Federico

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Federico wrote:I am wondering... do you think it would be possible to add an analog sonar, like the parallax ping?
http://www.parallax.com/tabid/768/Produ ... fault.aspx

What do you mean by "anolog"? My sonar device uses two distinct pins for triggering the echo and receiving the reply, but I guess the protocol is mostly identical. Should be possible to fit it to the controller.

Newflash: just bonded an ADNS-5050 optical sensor to the ATTiny4313 - this won't fit in an Tiny2313 anymore, but Tiny4313 with GPS, sonar and optical flow sensor is possible :-)
(but you can do optical + sonar)

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

Tommie wrote:
Federico wrote:I am wondering... do you think it would be possible to add an analog sonar, like the parallax ping?
http://www.parallax.com/tabid/768/Produ ... fault.aspx

What do you mean by "anolog"? My sonar device uses two distinct pins for triggering the echo and receiving the reply, but I guess the protocol is mostly identical. Should be possible to fit it to the controller.

Excuse me, it's digital. I was used to use the "PING" as described here
http://arduino.cc/en/Tutorial/Ping?from ... oundSensor
it's a good sonar and it exist also a "chinese" version from seeedstudio I think.

Newflash: just bonded an ADNS-5050 optical sensor to the ATTiny4313 - this won't fit in an Tiny2313 anymore, but Tiny4313 with GPS, sonar and optical flow sensor is possible :-)
(but you can do optical + sonar)

It's still possible to use a tiny2313 while not using the optical sensor?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Federico wrote:Excuse me, it's digital. I was used to use the "PING" as described here
http://arduino.cc/en/Tutorial/Ping?from ... oundSensor
it's a good sonar and it exist also a "chinese" version from seeedstudio I think.

Just like I expected; it should be quite easy to adapt the program to this sonar. It's more or less the same device I am using, except that it only has one IO pin for communication (mine however was cheaper, around 5€: http://www.satistronics.com/ultrasonic- ... p2539.html).
Newflash: just bonded an ADNS-5050 optical sensor to the ATTiny4313 - this won't fit in an Tiny2313 anymore, but Tiny4313 with GPS, sonar and optical flow sensor is possible :-)
(but you can do optical + sonar)

It's still possible to use a tiny2313 while not using the optical sensor?

Yes, using GPS and sonar is still possible with 2313, this is what I currently have employed in my copter.

If however you are about to get yourself a new controller, try to get an 4313; they were hard to obtain, but if you find a source for them, they are cheap and more powerful. I'm also about to port the firmware to ATMega controllers to utilize their capabilities, but don't hold your breath.

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

The Parallax sonar is expensive but I got it as a gift from a friend because it's popular on "let's make robots" (the sonar) so I will try to implement it... I do have some 2313 here and some extra atmega, I am going to use the 2313 for testing gps and sonar at the moment...

I am reading againt the thread because I don't get one thing, it's necessary to patch the multiwii software with your branch to use the tiny gps? If so, will you continue to develop patches for new multiwii version? :-)

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Sure, you have to apply my patches to make Multiwii query the TinyGPS module. You can find my very own git branch for that here: https://github.com/wertarbyte/multiwii- ... ee/tinygps
These changes include a few refactorings of the multiwii I²c subsystem, but don't be afraid, I am using the firmware myself :-)

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

I can be wrong but your git repository doesn't looks like containing patches but the whole multiwii code, am I right?
So it would be ok just to clone the repository and configure it?
On top of wich multiwii version are your patches?

ps. I am going to experiment the arduino isp, as I gave my usbtiny programmer to a friend for testing :-(

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Of course, you can use my git repository as a basis for your copter firmware.
The repository branch "upstream" is a clone of the svn trunk, most of my topic branches are based on this recent version (see https://github.com/wertarbyte/multiwii- ... t/upstream or your local gitk output).

Hint: Development (and life in general) would be so much easier if everone would be using git.

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

I have checked your upstream and tinygps repository and I have tried to do a diff between the original 2.0 multiwii version or a 2.0 dev version, but looks like there are a lot of changes. Are you following the develop of the 2.0, or patching the stable 2.0 ?

I think that git would be far better than google svn but alexinparis said that he is not able to use it and someone added that svn is good enaugh...

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

Just for reference if anyone needs this. I used the Arduino ISP sketch (as my programmer is not here right now) to burn a new attiny2313.

Quick linux howto: upload arduino isp on your arduino, connect pin like this: arduino 10-11-12-13 to (respectively) attiny 1-17-18-19. Connect attiny pin 10 to arduino gnd and attiny pin 20 to arduino +5v

Compile tiny-gps with "make" (first configure the config.h) and launch

avrdude -c avrisp -p t2313 -P /dev/ttyUSB0 -b 19200 -U flash:w:tiny-gps.hex -U lfuse:w:0xe4:m -U hfuse:w:0xdb:m

(change the dev port on your needs)

Well, I have to understand the multiwii part now :-)
Last edited by Federico on Fri May 11, 2012 6:42 pm, edited 1 time in total.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Federico wrote:If your attiny is brand new the fuse is already set at 8mhz. Anyway, for reference, this is the default fuse configuration

-U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

No, fresh ATTiny2313 do use the internal 8Mhz RC oscillator, but divide the clock by a factor of 8. You have to remove this clock divider, otherwise your controller will run at 1 MHz. ATTiny4313 devices will employ use a 4MHz oscillator by default.

For use on a battery powered copter, I'd also recommend enabling the brown out detector.

http://www.engbedded.com/fusecalc/ yields -U lfuse:w:0xe4:m -U hfuse:w:0xdb:m

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Federico wrote:I have checked your upstream and tinygps repository and I have tried to do a diff between the original 2.0 multiwii version or a 2.0 dev version, but looks like there are a lot of changes. Are you following the develop of the 2.0, or patching the stable 2.0 ?

The upstream branch is a clone of this: https://code.google.com/p/multiwii/sour ... 2FMultiWii

And these are the patches leading toward the tinygps branch:
https://github.com/wertarbyte/multiwii- ... ...tinygps

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

Just wondering... do you think that with tiny gps is going to work rth or pos hold ?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

I haven't tested it, but as you can see, I unified the code as much as possible with the serial GPS. The same variables are filled by tinygps, so if it works with serial GPS, it should work with my I²C module.

(see https://github.com/wertarbyte/multiwii- ... e9efa27a97)

Federico
Posts: 64
Joined: Thu Apr 05, 2012 12:32 am
Location: Italy
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Federico »

Just got a copy of the tiny-gps multiwii repository with
git clone https://github.com/wertarbyte/multiwii-firmware.git -b tinygps multiwii-tinygps
but, uncommented just the tiny-gps define for testing and trying to compile i get

MultiWii.cpp:1138:35: error: tiny-gps/nmea_structs.h: File o directory non esistente
MultiWii.cpp:1139:36: error: tiny-gps/sonar_structs.h: File o directory non esistente
MultiWii.cpp:1140:38: error: tiny-gps/optical_structs.h: File o directory non esistente
MultiWii.cpp:1141:34: error: tiny-gps/nav_structs.h: File o directory non esistente

(means not existent)

but they do exist and the permissions looks like ok. I don't use really the 1.0 arduino version but usually the 0.22 so I have to sort this problem out...

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

I am not using the Arduino IDE, but where does it search for include files? Surely in the working directory, right? If you are using a linux system, try merging the makefile branch and using plain old "make".
Last edited by Tommie on Fri May 11, 2012 7:32 pm, edited 1 time in total.

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Katch »

Is there a reason why you've decided to develop this on the ATTiny? Is it just as another option?

I seems like it is just doubling up on the work of I2C GPS devices that utilize an Arduino 328.

This is in no way meant as a criticism by the way - just trying to understand where this development fits into the scheme of things.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Tommie »

Katch wrote:Is there a reason why you've decided to develop this on the ATTiny? Is it just as another option?

Because the controllers are cheap, widely available and ...tiny.
I seems like it is just doubling up on the work of I2C GPS devices that utilize an Arduino 328.

I guess you are referring to ATMega328? Using an Arduino board for something like parsing GPS data and handing it over to I²C seems oversized. An Arduino board is around what, at least 18 EUR? You can get an ATTiny4313 for 1 EUR (in words: ONE Euro), slap it on top of your sensors and you are set. No need for the entire support circuitry the Arduino brings with it, just the single simple chip. I am looking into porting the code to ATMega controllers, but the Tiny is just enough for the job of working as a sensor nexus.

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by Katch »

Thanks - that makes sense.

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Tiny-GPS integrated into Multiwii (GPS/Sonar/Optical to

Post by dr.tom »

Could you please describe the procedure of compiling the .hex files needed for uploading to the attiny?
which program do you use, which files exactly do you open with it...
you say that clock needs to be set to 8MHz, there are 3 setting with 8MHz for that chip, +0ms, +4.1ms, and the +64ms (default), don't want to make it wrong...
believe just one line with defined fuses would help a lot: U lfuse:w:xx:x, U hfuse:w:xx:m, U efuse:w:xx:m


the procedure for 328 is well known, this attiny stuff is something new for most of us regular 'non coders' mwc users.

thank you for your effort :)

Post Reply