Make your own 1x1 22 IO pin Ardunio Compatible by dustinandrews
Featured

Step 12: Programming the ExtraCore (or a Pro-mini) with AVRDude and another Arduino

The ExtraCore and Arduino Pro-Mini don't have on board USB. Therefore you need a way to program them. The easiest way to is to buy an FTDI chip or cable. http://www.sparkfun.com/products/9716 is the one I use.

Here is an alternative method if you have another Ardunio, but don't have an FTDI interface.

WARNING: This will blow away your boot loader. You can always use this method to get it back or just keep loading sketches with this method. This method is for the adventuresome or impatient. AVRdude will happily turn your board into a useless coaster if you experiment with any fuse settings. Tread with caution.

Wiring from the existing Arduino
The picture shows a Pro-Mini, but any Arduino compatible should work.
  1.     Load ArduinoISP to your existing (or borrowed) Arduino. (see below "on the computer" for details).
  2.     Connect D9 to a resistor (220ohm-1k works with most leds) and a LED so you can see the "heartbeat".
  3.     Optionally connect  D7 and D8 so you can see what's going on. I don't normally use them when things are working.
  4.     Connect VCC and GND between the boards.
  5.     Connect D10 on the programmer to RST on your new board.
  6.     Connect D11 to D11
  7.     Connect D12 to D12
  8.     Connect D13 to D13

Connect the computer to the Arduino via the USB cable and determine the USB port. Mine was com16 so all my examples use that. Change to fit your situation.

On the computer

Prepare your software
  1.     Open the Arduino IDE
  2.     Load the ArduinoISP sketch
  3.     Double check the Serial.begin command is set to 19200.
  4.     Load it onto your Arduino and make a note of the serial port you used. You will need to use it below with AVRDude.
  5.     Check the heartbeat is working. If it ever stops when AVRDude isn't running, hit the reset button.
  6.     Install or locate WinAVR.
  7. Load the sketch you want to put on the ExtraCore
  8. Hit the "verify" button. This will compile the sketch to a .hex file.
  9. Locate the .hex file. (the .hex file is written to /tmp (on Mac and Linux) or \Documents and Settings\<USER>\Local Settings\Temp (on Windows)).
Check the connections
  1.     Open a command prompt. (Start->cmd.exe)
  2.     Use the CD command to change to the WinAVR bin directory. (remove quotes) "CD C:\winavr\bin" for example.
  3.     Run the following command  (remove angle brackets and use your own com port)

C:\winavr\bin\>avrdude -p m328p -P <com16> -c avrisp -b 19200

If all is well, you will see a chip signature of "0x1e9514" or "0x1e951"even if AVRDude says "Yikes I was expecting 0x1e951...".

Burn the sketch to the board

Replace the stuff in <angle brackets> with your path and sketch name.
C:\winavr\bin\>avrdude -p m328p -P com16 -c avrisp -b 19200 -F -U flash:w:<Path to your sketch>\<MySketchName>.hex


If all goes well AVRDUDE will put the sketch on the board and then verify that it worked. Your sketch is now ready to go.
 
Remove these adsRemove these ads by Signing Up
zen.webb says: Jun 18, 2012. 4:01 PM
I made a small batch of these boards, but am having a hard time programming them. I have a 5V FTDI breakout board sitting here, but not completely sure how to use it.

Do you have a link to an article or tutorial that you like with instructions on how to burn a bootloader using an FTDI board?

Thanks!
dustinandrews (author) says: Jun 18, 2012. 4:37 PM
It's possible to "bit bang" the bootloader on with nothing but the cable, but I have never done it.

You might try this method: http://www.instructables.com/id/Programming-Arduino-Bootloader-without-External-Pr/

Just borrowing a working Arduino from someone might be the easiest way.

Good luck!
zen.webb says: Jun 18, 2012. 5:19 PM
Oh, I thought you had used an FTDI cable for this - this step starts off with:

"The ExtraCore and Arduino Pro-Mini don't have on board USB. Therefore you need a way to program them. The easiest way to is to buy an FTDI chip or cable. http://www.sparkfun.com/products/9716 is the one I use."

I've tried FTDI bitbanging, Arduino as ISP and a couple of random guesses so far, but nothing has worked.

I will try the method you outline in this step sometime, I was just hoping for a more straightforward way - I've burned bootloaders and sketches onto the DIP ATMegas and ATTiny85s before with no problems, but this method is completely new to me :)

Thanks!
dustinandrews (author) says: Jun 18, 2012. 8:40 PM
Arduino as ISP should work. Can you be specific about where you are having problems and what, if any, error messages you see?
zen.webb says: Jun 19, 2012. 10:13 AM
The error I am getting right now is:

avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

I bought the following chip, which I thought was the same as the Arduino main board (in a different package): http://www.digikey.com/product-detail/en/ATMEGA328P-AU/ATMEGA328P-AU-ND/1832260

I have a hunch I'll need to modify my boards file in some way, but not sure yet.
dustinandrews (author) says: Jun 19, 2012. 11:38 AM
What signature are you getting? If it is "0x1e9514" you are good to go. Just use the -f flag. If it's "0x000000" or "0xFFFFF" then you have wiring problems.

The directions above mention 0x1e9514 being ok to use -f with, but I can see how it might be confusing.
zen.webb says: Jun 19, 2012. 12:24 PM
Crap. Using WinAVR I get a device signature of 0x000000 :( I guess I fried the chip during soldering. I don't have reflow equipment or the accessories (solder paste looks super expensive) so I soldered mine by hand - maybe I'll give it another go.

Where did you get your solder paste? My local hardware store has some cheap solder paste, but I thought it was for plumbing, NOT surface-mount reflow :P

dustinandrews (author) says: Jun 20, 2012. 12:21 PM
I would be shocked if you manage to ruin an Atmega chip by soldering. These things are far more resilient than they have any right to be. 0x00000 often means a ground fault. Break out your meter and strong magnfier and check each pair of pins for shorts. You probably just have a itty-bitty solder bridge.

You can clean it up with some solder wick most likely. I solder these chips by hand all the time and it's actually pretty easy. That resonator on the other hand, that thing is tricky to hand solder.
zen.webb says: Jun 20, 2012. 5:59 PM
Just checked all of my pins, pads and ground connections - there was one bridge between the XTAL1 pin and VCC from a botched solder job on the resonator. I used my multimeter to check every ground pin and connection to every other part of the board, and everything is set up correctly there. No bridges found between pins on the ATmega328.

I had to fix some solder bridges by over-applying solder to the ATmega328 pins in order for the wick to work. This is why I assumed I had fried my chip from heat - the chip got too hot to touch a couple of times :P I'm curious if maybe it's possible to a) burn out the resonator from heat or b) burn out the fuses of the ATmega328 chip to cause the invalid device signature error. Any thoughts there?

Just so you know, I attempted a second board yesterday and soldered it up much better - and it worked perfectly first try. Didn't even have to use avrdude at all! I will send you an e-mail and a pull request on Github soon with an Eagle library and other goodies :)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!