ATmega1284P: End to End using 1.0 IDE

wanderson:
Yes that was the bootloader that worked for me. No I don't have a schematic, but it was wired identically to the version on his site. Pretty basic, crystal, caps, resistor for reset line, and FTDI connections... all wirewrapped on a protoboard.

That's wierd.. I tried the original bootloader, but still got the programmer not in sync. Just to be sure I went to the nearest radio shack and bought a FTDI basic break out board (Sparkfun) and burned the orginial bootloader again. The avrdude output went a bit farther than usual but still it ended with the programmer not in sync error! Ahhhh, this chip is killing me!!! Don't know what to do anymore.

When I get home, I''ll post the hex file for the bootloader I use with 1284's
(see reply #64
http://arduino.cc/forum/index.php/topic,112020.60.html)
and then download sketches with via the IDE.
I am pretty sure it's maniacbug's bootloader from here
GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino
will find out for sure when I get home tho.
The bootloader was installed via IDE 1.0 (haven't put the 1284 cores into my 1.0.1 yet) and loaded with AVR ISP MKii programmer.

CrossRoads:
When I get home, I''ll post the hex file for the bootloader I use with 1284's
(see reply #64
http://arduino.cc/forum/index.php/topic,112020.60.html)
and then download sketches with via the IDE.
I am pretty sure it's maniacbug's bootloader from here
GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino
will find out for sure when I get home tho.
The bootloader was installed via IDE 1.0 (haven't put the 1284 cores into my 1.0.1 yet) and loaded with AVR ISP MKii programmer.

Looking forward to it =)! If it's maniacbugs bootloader then I doubt that it'll work, because i've already tried all of them. But if it's working for you then I'll gladly try the one you post =P!!

What I have definitely worked, one upload of the bootloader, and then about 30 sketch uploads as I checked out all the IO pins.
Hopefully there wasn't some other change I made that I've totally forgotten about O)

baselsw, try another 16MHz crystal. Maybe the one you have is defective/inaccurate.

Rats, I posted the files to the wrong thread:

Go there & grab them.

CrossRoads:
What I have definitely worked, one upload of the bootloader, and then about 30 sketch uploads as I checked out all the IO pins.
Hopefully there wasn't some other change I made that I've totally forgotten about O)

Thanks CrossRoads.. I'll try it out when I get home tonight!

@Florinc: I got a feeling that it could be the crystal.. I couldn't try any other one because that was the last one I had.. I'll go buy bunch later today! Thank you for the tip!!!

baselsw:

CrossRoads:
What I have definitely worked, one upload of the bootloader, and then about 30 sketch uploads as I checked out all the IO pins.
Hopefully there wasn't some other change I made that I've totally forgotten about O)

Thanks CrossRoads.. I'll try it out when I get home tonight!

@Florinc: I got a feeling that it could be the crystal.. I couldn't try any other one because that was the last one I had.. I'll go buy bunch later today! Thank you for the tip!!!

You might also want to look at the caps you are using with the crystal. I have a batch of crystals that work at frequency with 18pF caps, but are either well off frequency or not even oscillating with 22pF caps.

wanderson:

baselsw:

CrossRoads:
What I have definitely worked, one upload of the bootloader, and then about 30 sketch uploads as I checked out all the IO pins.
Hopefully there wasn't some other change I made that I've totally forgotten about O)

Thanks CrossRoads.. I'll try it out when I get home tonight!

@Florinc: I got a feeling that it could be the crystal.. I couldn't try any other one because that was the last one I had.. I'll go buy bunch later today! Thank you for the tip!!!

You might also want to look at the caps you are using with the crystal. I have a batch of crystals that work at frequency with 18pF caps, but are either well off frequency or not even oscillating with 22pF caps.

i'm using a 16MHz 30pF crystal with 22pF capacitors.. I dunno how sensitive these crystals are.. I already made a bunch of home made arduino uno's with the same crystals and caps... Hmmm, but I'll definitely give it a thought.. thx for the tip bro! :slight_smile:

Ohh this thing is killing me!! CrossRoads, I tried the bootloader you posted and I changed the crystals and I also tried changing the 22pF caps to 18pF caps. All of this gave me the same results when trying to upload the blink sketch. Error: programmer is out of sync!

Here is the avrdude output for burning the bootloader: https://dl.dropbox.com/u/74389175/Avrdude_bootloader_output.txt

And here is the Blink sketch output (Upload): https://dl.dropbox.com/u/74389175/Avrdude_Blink_sketch_output.txt

And here is my setup (sorry for the mess =P):
http://img94.imageshack.us/img94/4550/imag0291l.jpg

P.S The positive trail on the bottom of the breadboard is actually the ground trail and vice versa! D.S

I can't access those pages from here. Will look when I get home.

If your crystals are speced for 30pF, the 18pF would be worse than your 22pF. In my case my crystals were spec'd for 18pF and had problems with 22pF caps, which are closer to the crystal spec than your 22pF are to your crystal's 30pF spec.

Do you have an oscilliscope? It would be good to look at the oscillator waveform as well as the serial waveform.

wanderson:
If your crystals are speced for 30pF, the 18pF would be worse than your 22pF. In my case my crystals were spec'd for 18pF and had problems with 22pF caps, which are closer to the crystal spec than your 22pF are to your crystal's 30pF spec.

Do you have an oscilliscope? It would be good to look at the oscillator waveform as well as the serial waveform.

No, I don't have an oscilliscope. I'm a chemical engineer with a burning interest for electronics, so no expensive equipment here =P! Well i've already tried a couple of 30pF capacitors and even 47pF. All with the same output :S. It's kinda weird because I have the exact same crystal with 22pF capacitors on my home made UNO's, and it's working! And I'm programming my UNO's with the same FTDI board. So no problem there. If you look at my AVRDUDE output files from the previous post you'll see that my PC is successfully talking to the mega1284p. But something weird happens along the way. The connection suddenly times out in some way and later ends with the programmer is not in sync error. I can't explain nor understand what happened because the output is in HEX greek language =P!

Got any other ideas maybe??

I have the exact same crystal with 22pF capacitors on my home made UNO's

Do you share the crystal betweee the boards? :slight_smile:
They may look identical, but they are still different.

florinc:

I have the exact same crystal with 22pF capacitors on my home made UNO's

Do you share the crystal betweee the boards? :slight_smile:
They may look identical, but they are still different.

Loolll! I'm not an electrician but I do know how to read datasheets and order the exact same type of crystal =P! The crystals look the same and are of the same type/manufacturer/Load capacitance spec etc.. I promise =P! And the answer is no, I don't share the same crystal between boards. Much cheaper to just buy a bunch (time de-soldering = money).

As always, just because you ordered the "same" parts it doesn't mean they are all exactly the same. If they came from the same lot and were not pre-tested then you might have wound up with one that is out of spec and thus doesn't resonate correctly. Unless you can replace it with a known good working part you won't know if there is a problem with that particular crystal.

Personally I would doubt the problem being with the crystal, and instead I would look at bad connections/solder joints that are changing with slight changes in temperature.

avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20] 
avrdude: Recv: . [14] . [1e] . [97] . [05] . [10] 
################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9705
avrdude: Send: V [56] . [a0] . [0f] . [fc] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] . [a0] . [0f] . [fd] . [00]   [20] 
avrdude: Recv: 
avrdude: stk500_cmd(): programmer is out of sync

This is a very weird time for the programming to fail. It has executed a significant number of commands, indicating that communications is basically working. The 'V' command is not actually supported (this piece appears to read eeprom, for some reason), so the result is "faked", but that's already worked once as well.
Does the failure always happen in this same place?

westfw:

avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75]   [20]
avrdude: Recv: . [14] . [1e] . [97] . [05] . [10]
################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9705
avrdude: Send: V [56] . [a0] . [0f] . [fc] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [0f] . [fd] . [00]   [20]
avrdude: Recv:
avrdude: stk500_cmd(): programmer is out of sync



This is a very weird time for the programming to fail. It has executed a significant number of commands, indicating that communications is basically working. The 'V' command is not actually supported (this piece appears to read eeprom, for some reason), so the result is "faked", but that's already worked once as well.
Does the failure always happen in this same place?

Ya, the error always happens in the same place. I tried re-uploading the sketch like 30-40 times with the error appearing at the exact same place! That's why I don't think it's a faulty crystal. If it's a faulty crystal then the error should come randomly at any place.

Do you know what the reason is/can be for this kind of behavior?

kf2qd:
As always, just because you ordered the "same" parts it doesn't mean they are all exactly the same. If they came from the same lot and were not pre-tested then you might have wound up with one that is out of spec and thus doesn't resonate correctly. Unless you can replace it with a known good working part you won't know if there is a problem with that particular crystal.

Personally I would doubt the problem being with the crystal, and instead I would look at bad connections/solder joints that are changing with slight changes in temperature.

I agree, but the thing is that this is on a breadboard = no soldering and the connections are fine, successfully programmed the bootloader with the same connections/wires.

Well, if the watchdog was somehow not being reset properly, then it might reset the cpu at a fixed time into the upload procedure. But I'm not sure how that could happen. I wish the debugging output had timestamps.

But if this were the case, I'd think that it would not work for anyone, ever...