sparkfun atmega168 w/ arduino bootloader

How does the SparkFun ATmega168 behave when it's loaded in the Arduino?

aye swap chips with your arduino and see what it does

It seems to work fine in the arduino with just the led blink sketch, I haven't tried anything else. Is there something I should test for?

I can't really test too much in the standalone board, because I didn't use a breadboard. It's all soldered up into a really small package (2" x 1.5").

You have...

  • An Arduino with an ATmega168 processor
  • An ATmega168 processor purchased from SparkFun that has a bootloader installed
  • A "really small project"

Correct?

You program the Arduino processor while it's loaded in the Arduino, pull out the processor, put it in your really small project and everything works as you expect. Correct?

You program the SparkFun processor while it's loaded in the Arduino, pull out the processor, put it in your really small projects and it does not work as you expect. Correct?

Correct. Although it isn't really "a small project", it's just mounted on a really small PCB.

Heres the link to the project:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240844492

Are the markings on top of the two processors identical?

Yes, except for the 4 digit one next to "atmel" which I assume is the serial number

They both say "ATMEL atmega 168 - 20pu" on them.

Try this...

Put the SparkFun processor in the Arduino. Modify your program to blink and LED and output something simple to Serial and the end of loop. Upload the program. Let it run for several minutes.

Does the LED continue to blink?

Is the expected text sent through the serial connection?

Just tried that, everything worked fine. The LED continued to blink for several minutes, and the LCD displayed what I told it to. Also, I am using a sparkfun serial LCD, and I used this tutorial to set it up:
http://www.arduino.cc/playground/Learning/SparkFunSerLCD

I uploaded my bomb prop sketch into the sparkfun processor and left it in the arduino and got the same result as when it was in the standalone board (LCD displays nothing, loop seems to stop before even executing the first line).

You have an Arduino with an ATmega168 processor where the sketch you wrote works good, LCD works, everything is good.

You take that m168 chip to your "small board" and everything works good, LCD displays - life is good.

You have an ATmega168 processor purchased from SparkFun that has a bootloader installed. You install that chip to the Arduino, load the same sketch and everything works whiles on the Arduino, LCD displays - life is good.

You take the Sparkfun m168 from the Arduino board and install to "small board" - nothing works.... is that correct?

That should not happen - I move from Arduino to small boards all the time with no problems. Since the Arduino m168 works in the small board, that indicates you have everything setup correctly. You have a 28 pin DIP socket on the small board?

Good luck - I'm not sure where to go from here.

Ken H.

  • A "really small project"

no, the sparkfun processor will not work with my code on the arduino, or on the standalone. It does appear to work with really simple sketches though.

Could sparkfun be using a different bootloader?

OK, that makes more sense. I still don't know the answer, but before I was thinking the Sparkfun chip would work on Arduino but not on small board.

What is the full number on top of Sparkfun chip?

[edit]Something you might try with the Sparkfun m168 in the Arduino is a simple "hello World" sketch to display on serial monitor. If that is successful, then display to the LCD. This would confirm the Sparkfun m168 really is working correctly in the Arduino.[/edit]

Ken

On the top:
ATMEL 1005
ATMEGA168-20PU

On the bottom:
9J2808
35587D
1-P005 e3

I'm starting to get the impression that the SparkFun processor is defective.

Does your Sketch use the EEPROM?

Sure is interesting the Arduino m168 uC works both in Arduino and small board both.

The Sparkfun m168 "seems" to load the blink sketch ok, but nothing more complex? Can a m168 work with the blink sketch and have problems with a full program? That's why I asked about loading the "hello World" sketch and see it print out on serial monitor, then have it print to LCD display. If the Sparkfun m168 won't do those from the Arduino board.... I agree, must be a bad chip.

Ken H.

Can a m168 work with the blink sketch and have problems with a full program?

If a Flash cell is defective.

However, if the Bootloader verifies the uploaded Sketch then my theory is trash.

Does the bootloader now verify the uploaded sketch during a normal upload? Should the bootloader (or something) give an error msg if something didn't work correctly? even a defective chip?

Ken H>

The only thing I can think of is that something in the fuse settings is different on the Sparkfun chip than on the one from your Arduino. Either the Crystal Oscillator settings or the BrownOut detect could cause such failure to operate, I think. How sure are you of of the power supply and crystal circuitry on your external circuit?

I'm starting to get the impression that the SparkFun processor is defective.

Does your Sketch use the EEPROM?

Not that I know of. I don't have any read(), or write() functions in it.

[edit]The Sparkfun m168 "seems" to load the blink sketch ok, but nothing more complex?[/edit]

I did a test on the first page and the sparkfun processor did not have any problem running the blink sketch while outputting messages to the LCD.

However, if the Bootloader verifies the uploaded Sketch then my theory is trash.

Where would I see this? The arduino software doesn't give any errors when uploading.

The only thing I can think of is that something in the fuse settings is different on the Sparkfun chip than on the one from your Arduino. Either the Crystal Oscillator settings or the BrownOut detect could cause such failure to operate, I think. How sure are you of of the power supply and crystal circuitry on your external circuit?

I'm fairly certain my power supply is ok. I'm running it off a 12v sealed lead-acid battery, and there are caps on both the 12v and the 5v lines (as seen in the standalone arduino tutorial). I setup the crystal just like in the tutorial too, with one 22 pF capacitor running to ground from each pin.

I picked up a second sparkfun processor and i'm still having the same problem, so I don't think it's a defective chip.

to make simple without referring to the small board you have, just looking at the Arduino and the sparkfun m168.

The original m168 chip works good with all sketches in the Arduino - correct?

None of the Sparkfun chips will your complex sketch in the Arduino?

You mention the Sparkfun m168 will "run the blink sketch while outputting messages to the LCD" - what messages are you writing to the LCD? If you are writing things to the LCD it seems like it should be working, but you say the Sparkfun m168 does not run your sketch? Yet the Arduino m168 runs this sketch just fine?

Ken H>