Pages: [1]   Go Down
Author Topic: [Custom Duemilanove] Bootloader works only once  (Read 615 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey!

I built a small board with an Atmega168, flashed the Duemilanove bootloader to it using an STK500 (custom entry in the programmers.txt) with the Arduino IDE and tried to use the bootloader with an external FDTI board. So the first time I flash the blink example, it works without problems. The second time I try to upload anything, I get avrdude: stk500_recv(): programmer is not responding. If I reflash the bootloader, it works again, but only once. Can it be because I use an oscillator (external clock, only on XTAL1) instead of the crystal oscillator on the standard arduino boards? I tried to burn the bootloader and after that set the fuses using avrdude -p m168 -P /dev/ttyS0 -U lfuse:w:0xE0:m -U hfuse:w:0xdd:m -U efuse:w:0x00:m matching to the external clock. Same effect.
What I also noticed is that the Fade example does not fade but just blinks slowly. o.O

I use Arduino 1.0.2 btw. I remember having similar issues with an Atmega8 a few years back. (Bootloader working only once)
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you are not getting the fuses set correctly for your clock source.
Try having a go the Fuse calculator here
http://www.gammon.com.au/forum/?id=11653
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 1
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I always use http://www.engbedded.com/fusecalc which tends to work fine. I don't think that it's the fuses, because why should it work the first time? Does uploading via bootloader touch the fuses? I don't think so.
« Last Edit: November 09, 2012, 11:36:05 am by kopfkopfkopfaffe » Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

CrossRoads is correct.  It's your fuse settings.  I know, because I burned a few hours on this yesterday and the pain is still fresh.

Take a look at this website for the correct fuse settings:

http://letsmakerobots.com/node/28002

Specifically, I think it was the BOOTSZ or the BOOTRST fuse that was causing the behavior, but verify them all.

Good luck!
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the fuses are still broken, but I figured out why the fade-example did not work: Not a 'PWM-Pin'. That's exactly the problem with the Arduino 'abstraction layer': You're so detached from the actual hardware of the Atmega when you program. But still: my mistake smiley Anyway, I keep diggin into the fusebits.
Logged


Pages: [1]   Go Up
Jump to: