Pages: 1 [2] 3   Go Down
Author Topic: sparkfun atmega168 w/ arduino bootloader  (Read 3271 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

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

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

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

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

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
« Last Edit: April 04, 2010, 12:42:53 pm by KenH » Logged

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

On the top:
ATMEL 1005
ATMEGA168-20PU

On the bottom:
9J2808
35587D
1-P005 e3
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
Online Online
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Does your Sketch use the EEPROM?
Logged

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

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

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6782
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
Logged

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

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6782
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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.)
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13024
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Which keypad library are you using?

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

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