Pages: 1 2 [3]   Go Down
Author Topic: sparkfun atmega168 w/ arduino bootloader  (Read 3293 times)
0 Members and 1 Guest are viewing this topic.
Maine
Offline Offline
Sr. Member
****
Karma: 14
Posts: 418
Caution: Explosives in use.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"Anyone who isn't confused really doesn't understand the situation."

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 06, 2010, 01:18:24 pm by bcook » Logged

Mobile, AL
Offline Offline
Sr. Member
****
Karma: 0
Posts: 314
CAUTION!-Slow Learner
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>
Logged

Maine
Offline Offline
Sr. Member
****
Karma: 14
Posts: 418
Caution: Explosives in use.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 06, 2010, 01:44:46 pm by wizdum » Logged

"Anyone who isn't confused really doesn't understand the situation."

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I really like this one...

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

But it's a bit expensive.

« Last Edit: April 06, 2010, 01:53:13 pm by bcook » Logged

Mobile, AL
Offline Offline
Sr. Member
****
Karma: 0
Posts: 314
CAUTION!-Slow Learner
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 752
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)

Logged

Be The Change...

Maine
Offline Offline
Sr. Member
****
Karma: 14
Posts: 418
Caution: Explosives in use.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This?

http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
Logged

"Anyone who isn't confused really doesn't understand the situation."

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

Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 752
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

yes. I was a bit lazy to google and post it smiley-wink thanks to you.
Logged

Be The Change...

Maine
Offline Offline
Sr. Member
****
Karma: 14
Posts: 418
Caution: Explosives in use.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just tested it out and it worked great, THANKS! Now the code starts up as soon as the unit is powered up.
Logged

"Anyone who isn't confused really doesn't understand the situation."

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

Pages: 1 2 [3]   Go Up
Jump to: