I am having trouble getting the sparkfun atmega168 chips to work with my code. I have an Arduino Duemilanove, and a standalone breadboard setup (from here: http://www.arduino.cc/en/Main/Standalone) that I use in my actual project. I don't have an AVR programmer, so what I want to do is take the atmega168 from sparkfun (with the bootloader already on it) and put it in the Arduino, upload the code to it, and then put it in my standalone breadboard. When I do this with the atmega168 that came with my Arduino, there are no problems, but when I do the exact same thing with the sparkfun atmega168, it does not work at all. I get no display on my serial LCD, and no input is detected from any buttons. I did a quick test with the LED blink code from the playground, and that seemed to work fine.
Is there something else that I need to do? It shouldn't be a problem with my code, since it works with the original atmega, right?
But I just noticed something, that page says "pre-loaded with the Arduino Diecimila (16MHz) Bootloader ." I wrote and compiled the code for the duemilanove, could that be the problem?
When powering it up, I get the PWR led and the L led (and the tx/rx leds flash really quickly).
What do you mean you wrote and compiled the code for duemilanove? In Arduino 0018 the hardware option for both diecimila and duemilanove are the same (under tools->board).
I thought I might have to change the hardware settings under the tools menu (since when I first wrote this and tested it, I was using the duemilanove), but if they both use the same setting then that can't be the problem.
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?
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?
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]
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.