Atmega1284p programming problem

I've been having issues programming my 1284p chip. I have been able to burn a bootloader to it (Mighty1284 16mhz using Optiboot) Obtained from here.

I suspect this has worked properly but not 100% sure. Here is the output I get after writing the bootloader

avrdude -C ..\etc\avrdude.conf -c usbasp -P usb -p Atmega1284p -v -v

....


avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

The issue is when I use my FTDI device to try to write a program to the 1284p, I get the following response:

C:\Program Files (x86)\Arduino\hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -carduino -P\\.\COM7 -b115200 -D -Uflash:w:C:\Users\user\AppData\Local\Temp\build4651280890392470043.tmp\atmega1284p_test1.cpp.hex:i 

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM7
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: 
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.

The transmit light flashes 3x but no response.
Here is my setup:

higher res link: imgur

The caps on the crystal are .022nf and the rest are .1nf. The crystal is 16mhz and the resistor from reset to 5v is 1k.

Can anyone see what I am doing wrong here? I know the FTDI board works as I have used it to program other avrs, but I have never burnt a bootloader before. I know it did something as the fuse bits changed from the defaults, but I don't know of another way of testing to see if it was successful.

The bypass caps and reset dtr cap should be 0.1uf. Not 0.1nf.

.022nF as 22pF, unusual way to notate that.

Yeah that was just the range my multimeter was set for. I have replaced the caps with the proper values but still no change :frowning:

Uh, I just looked at the output from "burn bootloader". It looks like the board definition you had selected didn't use a bootloader - I just see it setting the fuses, not writing a bootloader.

The first log you've sent looks promising but it is just reading the fuses as DrAzzy wrote. Did you burn it? You can read the flash to check if bootloader is present.

Ok I reburnt the bootloader with verbose output on using the arduino IDE to trigger avrdude Here is the output during the burning process:

pastebin

Here is the output from avrdude after burning.

C:\Users\user\Desktop\arduino-1.0.6-1284p\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.conf -c usbasp -P usb -p Atmega1284p -v -
v

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "..\etc\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
avrdude: seen device from vendor ->www.fischl.de<-
avrdude: seen product ->USBasp<-
         AVR Part                      : ATMEGA1284P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

I still get the avrdude: stk500_getsync(): not in sync: resp=0x00 error after trying to upload a program.

Try F7 for the low fuse byte, that will select Full Swing Crystal Oscillator instead of Low Power Crystal Oscillator.

I gave that a shot but still giving the same output.

Also tried uploading using an arduino clone instead of the standalone FTDI board in case there was some issue there, but same problem.

I don't think that the problem is bootloader uploading. Your setup for ISP must be correct since it works. You can prove it by reading the bootloading part of the flashmem via ISP and data have to be same as BIN of bootloader. So the problem could be a bootloader or something else.
Did you used correct version? F_CPU must fit.
Early after reset at the start of bootloader L should to blink fast 3x.
Is your wiring for upload via bootloader correct (Rx, Tx, DTR/RESET)?

I'm pretty sure the wiring is correct, like you I don't think there is a problem with uploading the bootloader. I will look into verifying the data on it.

A few questions:

I'm using the optiboot_atmega1284p.hex by JChristensen. Which pin on the 1284p should I connect a LED up to to verify that it blinks on boot? Also I found some old bootloaders from maniacbug

ATmegaBOOT_1284P.hex
ATmegaBOOT_1284P_8MHz.hex

Should I give them a shot? In particular the 8mhz one, am I correct in assuming this will work without the external crystal? Just to eliminate one possible source of error (ebay crystals).

None of your posts show Avrdude being given the command to actually upload a bootloader. There should be something like -Uflash:w:NameOfBootloader.hex:i at the end of the Avrdude commandline, I don't see that. Does your boards.text file show a bootloader name and path? The output you have posted looks exactly like what you get when you invoke Avrdude without instructions to do anything. It initializes the micro, reads the fuses and then exits.

It's in one of my previous posts. The full output was too big for the forum so I linked it in a pastebin.

http://pastebin.com/4QFj7Ve4

Mighty has L led on PD5. Follow the variant and D13 Arduino port in the file pins_arduino.h e.g variants/standard/pins_arduino.h. Also you can use 'non crystal version' to exclude problems with crystal. However there is simple way to check crystal oscillation with multimeter on XTAL1 pin opposite to GND. DC voltage should be cca half of VCC. 2.5V should be if VCC=5V, since there is 50% square signal.