Go Down

Topic: sparkfun atmega168 w/ arduino bootloader (Read 3 times) previous topic - next topic

wizdum

Thats the library, but it looks like they changed some things from the version I am using.

Heres the new code that compiles with that library:
http://pastebin.com/v9YmTCn0
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Coding Badly

#31
Apr 06, 2010, 08:16 pm Last Edit: Apr 06, 2010, 08:18 pm by bcook Reason: 1
Quote
Thats the library, but it looks like they changed some things from the version I am using.

Thanks.


Following along westfw's idea, I had a theory and a method to prove / disprove the theory.

SparkFun calls the product "ATmega168 with Arduino Bootloader".  In the comments area, Matthew says, "Comes with the Fast Bootloader, Not the normal bootloader."  I've had problems with SparkFun's product descriptions so I think it's safe to assume Matthew is correct.  Unfortunately, there is no such thing as a "Fast Bootloader" for the Arduino.  I suspect he meant LadaAda's Bootloader.

http://www.sparkfun.com/commerce/product_info.php?products_id=8846

LadyAda clearly states that, "Please note that the fuses are different for this chip because of the extended memory!"

http://www.ladyada.net/library/arduino/bootloader.html

wizdum stated, "I wrote and compiled the code for the duemilanove".

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270072139/2#2

I assumed wizdum's Sketch was fairly large; big enough to use most of the Arduino Duemilanove's memory.  Compiling for, uploading to, and running from the Duemilanove processor works without a problem.

But what would happen to this same program, compiled for the Duemilanove and uploaded to the LadyAda processor?  My theory was that AVRDUDE would faithfully try to upload the program but would corrupt the image in the process.

However, the binary sketch size is 5450 bytes (of a 14336 byte maximum).  I rather suspect that LadyAda's bootloader will accommodate a 5450 byte Sketch.  Even if SparkFun used the wrong fuse settings, 1024 is the largest boot section.  There's still plenty of room for a 5450 byte Sketch.

I hate to say it wizdum.  I'm out of ideas.

KenH

You have done some research there.

Based on the comments from Sparkfun the bootloader is different than the normal bootloader, I'd sure be tempted to load a standard bootloader to the m168 chip an try that.

The chips "should" be the same, but perhaps something deep down inside the differences in bootloader code, fuses, etc is causing the problem?  Load the standard Arduino bootloader for the m168 and try that?

Other than that, I'm fresh out of ideas myself.

Ken H>

wizdum

#33
Apr 06, 2010, 08:42 pm Last Edit: Apr 06, 2010, 08:44 pm by wizdum Reason: 1
I noticed something interesting on the ladyada page:

Quote
Here's a bootloader hack that will automatically start the sketch after it has been uploaded and will also only start the bootloader when the reset button is pressed


I tried pressing the reset button on the arduino with the sparkfun processor in it, and it loaded my sketch after a second. It seems that the arduino processor automatically loads the sketch, while the sparkfun one waits for the reset button to be pressed each time the unit is powered up. This is going to be a problem as my standalone board does not have a reset button (there was no room for it on the board, and I can't allow the end user to restart the device whenever they want).

So it looks like i'm going to have to pick up a avr programmer. Any recommendations? I know AdaFruit sells the usbTinyISP, and I also saw this on sparkfun:
http://www.sparkfun.com/commerce/product_info.php?products_id=9231
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Coding Badly

#34
Apr 06, 2010, 08:51 pm Last Edit: Apr 06, 2010, 08:53 pm by bcook Reason: 1

I really like this one...

http://www.pololu.com/catalog/product/1300

But it's a bit expensive.


KenH

Here is one I am using - it's a kit, but only takes a few minutes to solder up - and it's $11 shipped - about the best price around.

http://www.fun4diy.com/AVRISP_mkII.htm

I do like the looks of the one linked by Coding - that scope function is interesting. C-B - how does the scope program work for you?

Ken H>

Coding Badly

Quote
I do like the looks of the one linked by Coding - that scope function is interesting. C-B - how does the scope program work for you?

I have not yet had the need nor opportunity to use it.  I've used everything else: the programmer, the TTL serial, and the "pass through" +5 volts.  I soldered a male header into the six pins on the side so it can be plugged into a breadboard.

One of the things I really like about the Pololu programmer is the very small size.  It's about the same size as the big USB connector.  I roll up the programmer with a USB cable attached and pack it away for travel.

pracas

I think you should put the bootloader onto it yourself. Easy to do. I think the arduino18 IDE supports that as well. if not there is a something on geocities for a duemilanove bitbang programmer. can read, modify and write fuses with that.(it uses avrdude and FTDI bitbang mode)

Be The Change...

wizdum

This?

http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

pracas

yes. I was a bit lazy to google and post it ;) thanks to you.
Be The Change...

wizdum

Just tested it out and it worked great, THANKS! Now the code starts up as soon as the unit is powered up.
"Anyone who isn't confused really doesn't understand the situation."

Electronic props for Airsoft, paintball, and laser tag -> www.nightscapetech.com

Go Up