Duemilanove Upload Problem

Ok, so I've been working on this for a few days now.

When trying to upload a sketch to my arduino duemilanove, it resets the arduino but never uploads the sketch. It gives me the message 'avrdude: stk500_getsync(): not in sync: resp=0x00'.

Before you ask! :) Yes, I have the correct com port. I've run a loopback to verify the FTDI can send and receive. Yes, I selected the correct board. Yes, I've tried other boards as well. Yes I have tried the reset button while uploading with various timing. Yes, I've run the verbose upload. Yes, I've tried another PC. Yes, I've even setup a looping batch file to continuously try to upload the sketch. I copied the verbose upload command to the batch file. (this helped with trying various timing) No, I don't have anything hooked to the TX or RX ports (0,1), I learned that already with a bluetooth board. Yes, I've wired the X3 port to the ICSP port and tried to burn the bootloader. No, it didn't work. No, I haven't fried the board. Yes, I'm positive. Yes, I ran this code on a 2nd arduino and now I have 2 arduinos with this problem!

I have a simple PWM fade app still running on the boards. It's actually a modified version of the tutorial app. It's modified to continue through the loop when counting up and down versus counting up then down then starting over again. I adjusted pins 9 and 10's PWM frequency to 32kHz as it was going to be used to control a motor and I don't like motor controllers with the annoying high pitch frequency.

Now, here's what I think is going on. I have 2 lines in the setup, adjusting the PWM frequency and starting serial at 9600, in that order. I think that making this adjustment to the PWM frequency and starting serial has screwed up the arduino's ability to receive the new sketch.

If anyone wants the code, I'll send it, but I don't want to screw up anyone else's arduino.

Obviously I'm looking to recover from this if possible. Any ideas?

You can post the code, I'm confident it won't screw anything up, that can't be recovered from. :)

Here’s the code.
If you know of any way to recover from it, please let me know!

Just remember, use at our own risk! :slight_smile:

/*
 Fading
 
 This example shows how to fade an LED using the analogWrite() function.
 
 The circuit:
 * LED attached from digital pin 9 to ground.
 
 Created 1 Nov 2008
 By David A. Mellis
 modified 30 Aug 2011
 By Tom Igoe
 
 http://arduino.cc/en/Tutorial/Fading
 
 This example code is in the public domain.
 
 */

int ledpin = 13;
int mpwmpin1 = 9;    // Motor PWM Pin
int mspeed1 = 0;
int mdir1 = 0;

void setup()  { 
   TCCR1B = TCCR1B & 0b11111000 | 0x01; // change PWM frequency on pins 9 and 10 to 32kHz
   Serial.begin(9600);
} 

void loop()  { 
  if (mspeed1 >= 254) {
    mspeed1=254;
    mdir1=0;
    delay(1000);
  }
  if (mspeed1 <= 0) {
    mspeed1=0;
    mdir1=1;
  }
  if (mdir1 == 1) {
    mspeed1++;
  }
  if (mdir1 == 0) {
    mspeed1--;
  }
  
  analogWrite(mpwmpin1, mspeed1); 
  analogWrite(ledpin, mspeed1); 
  Serial.print("Dir: ");
  Serial.print(mdir1);
  Serial.print(" Speed: ");
  Serial.println(mspeed1);


}

Well I uploaded it, and then uploaded it again. No problems there.

Since you seem to have multiple Arduinos try running my "chip detector" sketch:

http://www.gammon.com.au/forum/?id=11633

Unfortunately both arduinos are borked with the same code. I don't have a third to upload the sketch to. Looks like I'll be investing in a new board either way.

BTW, I was able to re-upload to these boards after this code was originally installed. It first seemed to get a little flaky in that it wouldn't always upload the sketch, but it got worse fairly quickly. I've also noticed that one of the chips seems to get pretty warm after it's been running for a while. Enough that it's to the point of being uncomfortable to hold my finger against it. The other one doesn't seem to get warm.

There's something wrong with the hardware then, they shouldn't get warm. What do you have connected to them exactly?

Right now, nothing. It's just the board. I've had it hooked to the itead bluetooth shield v2.0 as well as this motor controller. http://www.ebay.com/itm/281117109458

When problems started, it was not hooked to anything and I've only plugged in the bluetooth shield since.

try verfiy/compile then upload

Verify/compile the upload is still a no go. :(

Ok, got an arduino nano and I've ran the chip detector code.

One of the boards only gives me "Atmega chip detector." and nothing else. I assume the chip is toast.

The other board gives me...

Atmega chip detector.
Entered programming mode OK.
Signature = 1E 95 0F 
Processor = ATmega328P
Flash memory size = 32768
LFuse = FF 
HFuse = DA 
EFuse = FD 
Lock byte = CF 
Clock calibration = 9A 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 2048 bytes starting at 7800

Bootloader:

7800: 0C 94 34 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7810: 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7820: 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7830: 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7840: 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7850: 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 0C 94 51 3C 
7860: 0C 94 51 3C 0C 94 51 3C 11 24 1F BE CF EF D8 E0 
7870: DE BF CD BF 11 E0 A0 E0 B1 E0 EC E9 FF E7 02 C0 
7880: 05 90 0D 92 A2 30 B1 07 D9 F7 12 E0 A2 E0 B1 E0 
7890: 01 C0 1D 92 AD 30 B1 07 E1 F7 0E 94 2D 3D 0C 94 
78A0: CC 3F 0C 94 00 3C 98 2F 95 95 95 95 95 95 95 95 
78B0: 90 5D 8F 70 8A 30 7C F0 28 2F 29 5A 80 91 C0 00 
78C0: 85 FF FC CF 90 93 C6 00 80 91 C0 00 85 FF FC CF 
78D0: 20 93 C6 00 08 95 28 2F 20 5D F0 CF 98 2F 80 91 
78E0: C0 00 85 FF FC CF 90 93 C6 00 08 95 EF 92 FF 92 
78F0: 0F 93 1F 93 EE 24 FF 24 87 01 80 91 C0 00 87 FD 
7900: 17 C0 08 94 E1 1C F1 1C 01 1D 11 1D 81 E4 E8 16 
7910: 82 E4 F8 06 8F E0 08 07 80 E0 18 07 70 F3 E0 91 
7920: 04 01 F0 91 05 01 09 95 80 91 C0 00 87 FF E9 CF 
7930: 80 91 C6 00 1F 91 0F 91 FF 90 EF 90 08 95 0E 94 
7940: 76 3C 98 2F 80 91 C0 00 85 FF FC CF 90 93 C6 00 
7950: 91 36 2C F4 90 33 0C F0 90 53 89 2F 08 95 97 55 
7960: 89 2F 08 95 1F 93 0E 94 9F 3C 18 2F 0E 94 9F 3C 
7970: 12 95 10 7F 81 0F 1F 91 08 95 1F 93 18 2F 88 23 
7980: 21 F0 0E 94 76 3C 11 50 E1 F7 1F 91 08 95 1F 93 
7990: 18 2F 0E 94 76 3C 80 32 49 F0 80 91 03 01 8F 5F 
79A0: 80 93 03 01 85 30 C1 F0 1F 91 08 95 80 91 C0 00 
79B0: 85 FF FC CF 84 E1 80 93 C6 00 80 91 C0 00 85 FF 
79C0: FC CF 10 93 C6 00 80 91 C0 00 85 FF FC CF 80 E1 
79D0: 80 93 C6 00 1F 91 08 95 E0 91 04 01 F0 91 05 01 
79E0: 09 95 1F 91 08 95 0E 94 76 3C 80 32 41 F0 80 91 
79F0: 03 01 8F 5F 80 93 03 01 85 30 81 F0 08 95 80 91 
7A00: C0 00 85 FF FC CF 84 E1 80 93 C6 00 80 91 C0 00 
7A10: 85 FF FC CF 80 E1 80 93 C6 00 08 95 E0 91 04 01 
7A20: F0 91 05 01 09 95 08 95 40 E9 51 E0 88 23 A1 F0 
7A30: 2D 9A 28 EE 33 E0 FA 01 31 97 F1 F7 21 50 30 40 
7A40: D1 F7 2D 98 28 EE 33 E0 FA 01 31 97 F1 F7 21 50 
7A50: 30 40 D1 F7 81 50 61 F7 08 95 3F 92 4F 92 5F 92 
7A60: 6F 92 7F 92 8F 92 9F 92 AF 92 BF 92 CF 92 DF 92 
7A70: EF 92 FF 92 0F 93 1F 93 CF 93 DF 93 00 00 80 E1 
7A80: 80 93 C4 00 10 92 C5 00 88 E1 80 93 C1 00 86 E0 
7A90: 80 93 C2 00 50 98 58 9A 25 9A 81 E0 0E 94 14 3D 
7AA0: 24 E1 F2 2E 9E E1 E9 2E 85 E9 D8 2E 0F E0 C0 2E 
7AB0: 10 E1 B1 2E AA 24 A3 94 B1 E4 9B 2E A6 E5 8A 2E 
7AC0: F2 E5 7F 2E E0 E2 6E 2E 79 E4 57 2E 63 E5 46 2E 
7AD0: 50 E5 35 2E 0E 94 76 3C 80 33 B1 F1 81 33 B9 F1 
7AE0: 80 34 09 F4 6F C0 81 34 09 F4 76 C0 82 34 09 F4 
7AF0: 85 C0 85 34 09 F4 88 C0 80 35 31 F1 82 35 21 F1 
7B00: 81 35 11 F1 85 35 09 F4 85 C0 86 35 09 F4 8D C0 
7B10: 84 36 09 F4 96 C0 84 37 09 F4 03 C1 85 37 09 F4 
7B20: 72 C1 86 37 09 F4 66 C0 80 91 03 01 8F 5F 80 93 
7B30: 03 01 85 30 79 F6 E0 91 04 01 F0 91 05 01 09 95 
7B40: 0E 94 76 3C 80 33 51 F6 0E 94 F3 3C C3 CF 0E 94 
7B50: 76 3C 80 32 49 F7 80 91 C0 00 85 FF FC CF F0 92 
7B60: C6 00 80 91 C0 00 85 FF FC CF 90 92 C6 00 80 91 
7B70: C0 00 85 FF FC CF 80 92 C6 00 80 91 C0 00 85 FF 
7B80: FC CF 70 92 C6 00 80 91 C0 00 85 FF FC CF 60 92 
7B90: C6 00 80 91 C0 00 85 FF FC CF 50 92 C6 00 80 91 
7BA0: C0 00 85 FF FC CF 40 92 C6 00 80 91 C0 00 85 FF 
7BB0: FC CF 30 92 C6 00 80 91 C0 00 85 FF FC CF B0 92 
7BC0: C6 00 88 CF 0E 94 76 3C 86 38 08 F4 BD CF 0E 94 
7BD0: 76 3C 0E 94 F3 3C 7E CF 0E 94 76 3C 80 38 09 F4 
7BE0: 9C C0 81 38 09 F4 0B C1 82 38 09 F4 3C C1 88 39 
7BF0: 09 F4 8F C0 80 E0 0E 94 C7 3C 6C CF 84 E1 0E 94 
7C00: BD 3C 0E 94 F3 3C 66 CF 85 E0 0E 94 BD 3C 0E 94 
7C10: F3 3C 60 CF 0E 94 76 3C 80 93 06 01 0E 94 76 3C 
7C20: 80 93 07 01 0E 94 F3 3C 55 CF 0E 94 76 3C 80 33 
7C30: 09 F4 1D C1 83 E0 0E 94 BD 3C 80 E0 0E 94 C7 3C 
7C40: 49 CF 0E 94 76 3C 80 93 09 02 0E 94 76 3C 80 93 
7C50: 08 02 80 91 0C 02 8E 7F 80 93 0C 02 0E 94 76 3C 
7C60: 85 34 09 F4 15 C1 80 91 08 02 90 91 09 02 89 2B 
7C70: 89 F0 00 E0 10 E0 0E 94 76 3C F8 01 E8 5F FE 4F 
7C80: 80 83 0F 5F 1F 4F 80 91 08 02 90 91 09 02 08 17 
7C90: 19 07 88 F3 0E 94 76 3C 80 32 09 F0 45 CF 80 91 
7CA0: 0C 02 80 FF 01 C1 60 91 06 01 70 91 07 01 66 0F 
7CB0: 77 1F 70 93 07 01 60 93 06 01 A0 91 08 02 B0 91 
7CC0: 09 02 10 97 C9 F0 E8 E0 F1 E0 9B 01 AD 01 4E 0F 
7CD0: 5F 1F F9 99 FE CF 32 BD 21 BD 81 91 80 BD FA 9A 
7CE0: F9 9A 2F 5F 3F 4F E4 17 F5 07 99 F7 6A 0F 7B 1F 
7CF0: 70 93 07 01 60 93 06 01 80 91 C0 00 85 FF FC CF 
7D00: F0 92 C6 00 80 91 C0 00 85 FF FC CF B0 92 C6 00 
7D10: E1 CE 83 E0 0E 94 C7 3C DD CE 82 E0 0E 94 C7 3C 
7D20: D9 CE 0E 94 76 3C 80 93 09 02 0E 94 76 3C 80 93 
7D30: 08 02 80 91 06 01 90 91 07 01 88 0F 99 1F 90 93 
7D40: 07 01 80 93 06 01 0E 94 76 3C 85 34 09 F4 A6 C0 
7D50: 80 91 0C 02 8E 7F 80 93 0C 02 0E 94 76 3C 80 32 
7D60: 09 F0 B8 CE 80 91 C0 00 85 FF FC CF F0 92 C6 00 
7D70: 60 91 08 02 70 91 09 02 61 15 71 05 B9 F1 40 E0 
7D80: 50 E0 80 91 0C 02 A8 2F A1 70 B8 2F B2 70 11 C0 
7D90: BB 23 09 F4 5C C0 E0 91 06 01 F0 91 07 01 31 96 
7DA0: F0 93 07 01 E0 93 06 01 4F 5F 5F 4F 46 17 57 07 
7DB0: E8 F4 AA 23 69 F3 F9 99 FE CF 20 91 06 01 30 91 
7DC0: 07 01 32 BD 21 BD F8 9A 90 B5 80 91 C0 00 85 FF 
7DD0: FC CF 90 93 C6 00 2F 5F 3F 4F 30 93 07 01 20 93 
7DE0: 06 01 4F 5F 5F 4F 46 17 57 07 18 F3 80 91 C0 00 
7DF0: 85 FD E5 CE 80 91 C0 00 85 FF F8 CF E0 CE 81 E0 
7E00: 0E 94 C7 3C 67 CE 0E 94 76 3C 80 32 09 F0 8C CE 
7E10: 80 91 C0 00 85 FF FC CF F0 92 C6 00 80 91 C0 00 
7E20: 85 FF FC CF E0 92 C6 00 80 91 C0 00 85 FF FC CF 
7E30: D0 92 C6 00 80 91 C0 00 85 FF FC CF C0 92 C6 00 
7E40: 80 91 C0 00 85 FF FC CF B0 92 C6 00 43 CE E0 91 
7E50: 06 01 F0 91 07 01 94 91 80 91 C0 00 85 FF FC CF 
7E60: 90 93 C6 00 9C CF 80 E1 0E 94 C7 3C 33 CE 0E 94 
7E70: 76 3C 0E 94 76 3C 18 2F 0E 94 76 3C 11 23 09 F4 
7E80: 83 C0 11 30 09 F4 84 C0 8F E0 0E 94 C7 3C 22 CE 
7E90: 80 91 0C 02 81 60 80 93 0C 02 E5 CE 80 91 0C 02 
7EA0: 81 60 80 93 0C 02 59 CF 80 91 07 01 88 23 88 0F 
7EB0: 88 0B 8A 21 80 93 0B 02 80 91 06 01 90 91 07 01 
7EC0: 88 0F 99 1F 90 93 07 01 80 93 06 01 80 91 08 02 
7ED0: 80 FF 09 C0 80 91 08 02 90 91 09 02 01 96 90 93 
7EE0: 09 02 80 93 08 02 F8 94 F9 99 FE CF 11 27 E0 91 
7EF0: 06 01 F0 91 07 01 C8 E0 D1 E0 80 91 08 02 90 91 
7F00: 09 02 10 30 91 F4 00 91 57 00 01 70 01 30 D9 F3 
7F10: 03 E0 00 93 57 00 E8 95 00 91 57 00 01 70 01 30 
7F20: D9 F3 01 E1 00 93 57 00 E8 95 09 90 19 90 00 91 
7F30: 57 00 01 70 01 30 D9 F3 01 E0 00 93 57 00 E8 95 
7F40: 13 95 10 34 98 F0 11 27 00 91 57 00 01 70 01 30 
7F50: D9 F3 05 E0 00 93 57 00 E8 95 00 91 57 00 01 70 
7F60: 01 30 D9 F3 01 E1 00 93 57 00 E8 95 32 96 02 97 
7F70: 09 F0 C7 CF 10 30 11 F0 02 96 E5 CF 11 24 80 91 
7F80: C0 00 85 FF B9 CE BC CE 8E E1 0E 94 C7 3C A2 CD 
7F90: 85 E9 0E 94 C7 3C 9E CD F8 94 FF CF 80 00 FF FF 
7FA0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
7FB0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
7FC0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
7FD0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
7FE0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
7FF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 

MD5 sum of bootloader = 0A AC F7 16 F4 3C A2 C9 27 7E 08 B9 D6 90 BC 02 

First 256 bytes of program memory:

0: 0C 94 62 00 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 
10: 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 
20: 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 
30: 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 
40: 0C 94 0C 01 0C 94 8A 00 0C 94 C3 02 0C 94 0A 03 
50: 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 0C 94 8A 00 
60: 0C 94 8A 00 0C 94 8A 00 00 00 00 00 24 00 27 00 
70: 2A 00 00 00 00 00 25 00 28 00 2B 00 00 00 00 00 
80: 23 00 26 00 29 00 04 04 04 04 04 04 04 04 02 02 
90: 02 02 02 02 03 03 03 03 03 03 01 02 04 08 10 20 
A0: 40 80 01 02 04 08 10 20 01 02 04 08 10 20 00 00 
B0: 00 07 00 02 01 00 00 03 04 06 00 00 00 00 00 00 
C0: 00 00 81 04 11 24 1F BE CF EF D8 E0 DE BF CD BF 
D0: 11 E0 A0 E0 B1 E0 EE E0 FD E0 02 C0 05 90 0D 92 
E0: A4 32 B1 07 D9 F7 11 E0 A4 E2 B1 E0 01 C0 1D 92 
F0: A8 3D B1 07 E1 F7 10 E0 C4 EC D0 E0 04 C0 22 97

So what's your idea as to what's going on? Why can't I program it?

FYI, I've ran my problematic code on the nano without issue.

Which board are you referring to? The one which does not display anything other than "Atmega chip detector."?

It may be toast, especially if this is the one that got hot.

I have 3 arduinos. 2 duemilanoves (both have issues) and 1 nano (new board). I've wired the nano to read the duemilanoves. One duemilanove gives me the "Atmega chip detector." only. The other duemilanove gives me the output below. This is the one that gets hot eventually. I cannot program either board.

I take it both are toast then?

The one which gave good output above seems to have the Duemilanove bootloader on it. It looks OK to me. You should be able to program it if you select the Duemilanove in the Boards menu.

Just for S&Gs, I swapped the chips from one duemilanove board to the other. The chip that did not return any information, works in the other board. YAY! I was able to send a program and it accepted it and appears to be working. I have not tested any of the pins nor ran the chip detector utility yet.

The other chip that gets hot but returned the information, still does not work in the other board. It also still gets hot in the other board. It sounds like I have 1 bad board, and 1 bad chip. Chip can be easily replaced, in fact, I have 1 on the way.

Any ideas as to the problem with the board? I'll do some testing on on the board to see if I can figure out what's going on.

Interestingly, the board that works, does not return anything with the chip detector.
In fact, neither board does now.