Pages: [1]   Go Down
Author Topic: Can't program super barebones ATMEGA328 circuit with  (Read 698 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 254
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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:

Code:
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:

Code:
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.




* eyewriter-schematic.png (44.63 KB, 1710x1065 - viewed 33 times.)

* eyewriter-pcb.png (68.63 KB, 919x1016 - viewed 32 times.)

* 000_0010.JPG (557.19 KB, 2048x1536 - viewed 31 times.)

* 000_0012.JPG (591.64 KB, 2048x1536 - viewed 22 times.)
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8665
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 29
Posts: 582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).

Logged

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 254
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-razz

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.


* ffffffuuuuuu.png (109.91 KB, 1280x984 - viewed 23 times.)
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 29
Posts: 582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is really a cool project!

Logged

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 254
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley Thanks guys!
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

Pages: [1]   Go Up
Jump to: