Go Down

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

wizdum

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?
"Anyone who isn't confused really doesn't understand the situation."

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

KenH

#16
Apr 04, 2010, 07:23 pm Last Edit: Apr 04, 2010, 07:42 pm by KenH Reason: 1
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

wizdum

On the top:
ATMEL 1005
ATMEGA168-20PU

On the bottom:
9J2808
35587D
1-P005 e3
"Anyone who isn't confused really doesn't understand the situation."

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

Coding Badly


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

Does your Sketch use the EEPROM?

KenH

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.

Coding Badly

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

KenH

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>

westfw

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?

wizdum

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

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

Quote
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.  
"Anyone who isn't confused really doesn't understand the situation."

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

KenH

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>

wizdum

Yes, the original chip works fine in both. The sparkfun chip wont work in the arduino with my sketch, but it will display text on the LCD and blink the led.
"Anyone who isn't confused really doesn't understand the situation."

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

KenH

Since the sparkfun m168 will run most all sketches in the Arduino - except for your code, why don't you post it here?  there are some really good code folks here that might have an idea.

Since the bootloader is loaded from Sparkfun the fuses "should" be set correctly - that would control the brownout function.  I'm not sure how to check the fuses with the Arduino IDE - I use an external programmer with AVRdude or Studio4 to check fuses and normally use that to burn my sketches to a m168 without the bootloader for my project boards.

Good luck,

Ken H>

wizdum

The code is in the topic for my project that I linked to on the first page. I uploaded the code here:
http://pastebin.com/f57045830
"Anyone who isn't confused really doesn't understand the situation."

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

westfw

Code: [Select]
I'm not sure how to check the fuses with the Arduino IDE
I don't believe that it is possible to do so :-(
(nor is it documented that a program running on the AVR can read fuses, although it wouldn't surprise me if they show up at some undocumented register address.)

Does anyone have all of 1) Regular Arduino m168 chip  2) Sparkfun m168 chip  3) "real" programmer of some kind (capable of reading fuses.)

Coding Badly


Which keypad library are you using?

I tried the one here but the Sketch won't compile...
http://www.arduino.cc/playground/Code/Keypad

Go Up