Can't program super barebones ATMEGA328 circuit with

I'm trying to flash the Uno bootloader onto a fresh ATMega328 that is on a prototype PCB I am working on, but it just isn't working. I've populated the board with only the ATMega328, a 16 Mhz resonator and the 10k pull-up resistor to VCC. I'm really at a loss for what is happening, since I am able to program other boards with no problems. Any help is appreciated at this point :slight_smile:

Using Arduino 1.0.5, I select "Arduino Uno" from the Tools > Board type menu and "USBtinyISP" from the Tools > Programmer menu. I click on Tools > Burn bootloader and immediately get this error in the console:

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

I am able to use the USBtinyISP to program a spare Arduino board with no problems.

I've attached the schematic, PCB design and some pictures so you can see that nothing is loading down the MOSI/MISO/SCK pins.

In the PCB there is a ground fill on both the top and bottom layers.

Here is the complete output from the "verbose output" mode:

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                    : lpt1
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [ff ff ff ff]
CMD: [ac 53 00 00] [ff ff ff ff]
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Looks like maybe a bad connection. Check the traces from the ICSP connector to the processor. If any of them is open or shorted to +5 or Ground the programming will fail.

Does the power LED light up? At least that means you don't have the cable on backwards. :slight_smile:

I looks like you pcb has the ICSP header pin-4 MOSI going to the wrong connection. You have the MOSI pin from the ICSP header going to mega328P PD6 OC0A pin (Right glint board) instead of PB3 MOSI (Left glint board).

hiduino, you are a BAMF, you know that? I've attached a photo of what happens when I try to move the net name for the MOSI line. Notice how the thin black line is pointing to a different net entirely than the one the text is touching.

I have no idea how I managed to do this absolutely ridiculous error, but I definitely deserved to sweat for a little while :stuck_out_tongue:

So now the question is, is it a simple fix? Obviously I'll order new boards with the routes corrected, but I wonder if I can still salvage this batch of boards using some wire to create the correct route from the ICSP MOSI pin to the ATMega's MOSI pin. Maybe I can use a knife to sever the existing trace from the ICSP's MOSI pin to make sure signals don't get crossed later.

zenwebb:
So now the question is, is it a simple fix? Obviously I'll order new boards with the routes corrected, but I wonder if I can still salvage this batch of boards using some wire to create the correct route from the ICSP MOSI pin to the ATMega's MOSI pin. Maybe I can use a knife to sever the existing trace from the ICSP's MOSI pin to make sure signals don't get crossed later.

Yes, use a sharp knife or dremel to cut a small section out of the incorrect trace, and add a wire where the connection should be. Solderable enamelled copper wire works well for this type of repair. You can glue the wire down using silicone.

This is really a cool project!

Thanks hiduino, it'll be even cooler when its all working!

I was able to cut the trace and solder a wire to make the necessary connection. Programming went down without a hitch :slight_smile: Thanks guys!