Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« on: March 31, 2010, 04:48:59 pm » |
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?
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
ottawa, canada
Offline
God Member
Karma: 4
Posts: 973
Arduino rocks
|
 |
« Reply #1 on: March 31, 2010, 07:44:18 pm » |
Do you know for sure that the sparkfun chip has the bootloader on it?
What messages do you get when you load it?
|
|
|
|
« Last Edit: March 31, 2010, 07:49:21 pm by bill2009 »
|
Logged
|
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #2 on: March 31, 2010, 07:51:31 pm » |
This is the one I got: http://www.sparkfun.com/commerce/product_info.php?products_id=8846But 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).
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
CT, USA
Offline
Sr. Member
Karma: 2
Posts: 446
Arduino rocks
|
 |
« Reply #3 on: March 31, 2010, 08:07:07 pm » |
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).
|
|
|
|
|
Logged
|
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #4 on: March 31, 2010, 08:11:04 pm » |
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.
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 129
Posts: 10373
|
 |
« Reply #5 on: March 31, 2010, 08:23:29 pm » |
How does the SparkFun ATmega168 behave when it's loaded in the Arduino?
|
|
|
|
|
Logged
|
|
|
|
|
SE USA
Offline
Faraday Member
Karma: 35
Posts: 3649
@ssh0le
|
 |
« Reply #6 on: March 31, 2010, 08:41:39 pm » |
aye swap chips with your arduino and see what it does
|
|
|
|
|
Logged
|
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #7 on: April 01, 2010, 09:22:30 pm » |
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").
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 129
Posts: 10373
|
 |
« Reply #8 on: April 01, 2010, 11:37:08 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #9 on: April 01, 2010, 11:42:06 pm » |
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
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 129
Posts: 10373
|
 |
« Reply #10 on: April 01, 2010, 11:43:14 pm » |
Are the markings on top of the two processors identical?
|
|
|
|
|
Logged
|
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #11 on: April 01, 2010, 11:55:58 pm » |
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.
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 129
Posts: 10373
|
 |
« Reply #12 on: April 02, 2010, 12:44:11 am » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Maine
Offline
Sr. Member
Karma: 8
Posts: 335
Caution: Explosives in use.
|
 |
« Reply #13 on: April 04, 2010, 01:08:08 am » |
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/SparkFunSerLCDI 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).
|
|
|
|
|
Logged
|
"Anyone who isn't confused really doesn't understand the situation." Arduino-based airsoft props -> www.nightscapetech.com
|
|
|
|
Mobile, AL
Offline
Sr. Member
Karma: 0
Posts: 314
CAUTION!-Slow Learner
|
 |
« Reply #14 on: April 04, 2010, 12:14:06 pm » |
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"
|
|
|
|
« Last Edit: April 04, 2010, 12:14:44 pm by KenH »
|
Logged
|
|
|
|
|
|