ATmega 1280 download problem

I have created a custom Arduino board based EXACTLY off the ATMega schematic for our uni project.
I can successfully downloaded the bootloader (ATmegaBOOT_168_atmega1280.hex) with ArduinoISP (and can repeat this process) with both the Arduino IDE and avrdude but cannot program the boad with a sketch over USB.

I am running Windows 7, but have tried this with XP and Ubuntu as well. My computer detects the com port but when i try to program the board, the light on the board flashes 3 times and then i get the error message:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Does anyone have any ideas?
Thanks in advance for your help
James

As you are at a uni, get an oscilloscope (preferably a digital for single shot operation) and look at the signal on the reset pin. You should see at least two spikes like this:

10V              *
                 **
                 * *
                 *  *
5V               *    *
***********      *      ********
          *    *
          *  *
          * *
          **
0V        *

The dip to 0V should reset the microcontroller.

Ok so here is the output from the bootloader with avrdude

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as F5

Fuses are ok an match what they should be for atmega 1280

but still cannot program via usb!
I have wired the programmer right to the reset line at the controller and still no luck!
i assume it is programming the bootloader correctly as it is reading back the correct values.

i am still getting the error
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

just to clarify, i do not see this spike on the cro.
I checked between the resistor and cap on the microcontroller side of the reset line and on the ftdi reset side too.
Neither of these show the spike as would be expected

ok minor success. I missed the cap to ground ont he reset line. Now with it soldered i can see the spike, but it only pullsdow to about 2.5V rather than to zero.
I guess i need either a larger cap or a smaller pullup resistor to get this all the way to zero?

and if i take the cap out completey and just have a trace, it pulls to low no problem, but never comes back up

What values do you have for the DTR cap and pullup resistor?
My '1284 Bobuino (link in my signature below) uses 100nF and 10K, I have no problems uploading with FT232RL as the USB/Serial source.

i also have the sanme values.
I did a quick simulation and these values don't seem to pull down far enough (what i see ont he cro too)
I changed the cap to around 22uF and this seems to pull down far enough. i am going to test this out on the baord this afternoon.

I understand how this is happening...but why would the values be so different?

thanks for the reply.
i'll let you know how it goes

The 100nF / 0.1uF would get pulled down pretty quick, and go back up fairly quick.
22uF, that would take a lot longer to move.
Its got to get down to <0.9V for 2.5uS or more.

So i tried 22u and also 10u. The 10u dropped the voltage but it had a very long rise time (a couple seconds). Got to 5V, stayed there for a few more seconds, then spiked up to ~8V to slowly cam back down.

It looks as though a 1u or so cap should be ok. Is there a limit as to how long the rise time back to ~5V should be?

Those caps are too big. 100nF = 0.1uF.
Not 10uF, not 1uF.
0.1uF. Much smaller.

There is a power on rise time limit, I don't see one for a regular reset.

yes i realise that. but 100n (0.1u) gives the spike that is required on the reset line but is far too small.
It doesn't even drop it to less than 4.5V

Very odd.

I think the schematic is just wrong.

I've attached two LTSpice simulations.

a) original schematic from MEGA 1280 board with 2 capacitors. This is just wrong. With the additional capacitor to ground, you can only get down to Vcc/2 with two identical capacitors. To get down further, a bigger C1 is needed. This is just like charging two identical capacitors in series. The middle point is Vcc/2.

b) how it was done on the Duemilanove board. NO capacitor to ground, works perfectly - in simulation and reality.

reset_bad.asc (1.01 KB)

reset_good.asc (886 Bytes)