Step 12: Programming the ExtraCore (or a Pro-mini) with AVRDude and another Arduino
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.
- Load ArduinoISP to your existing (or borrowed) Arduino. (see below "on the computer" for details).
- Connect D9 to a resistor (220ohm-1k works with most leds) and a LED so you can see the "heartbeat".
- Optionally connect D7 and D8 so you can see what's going on. I don't normally use them when things are working.
- Connect VCC and GND between the boards.
- Connect D10 on the programmer to RST on your new board.
- Connect D11 to D11
- Connect D12 to D12
- 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
- Open the Arduino IDE
- Load the ArduinoISP sketch
- Double check the Serial.begin command is set to 19200.
- Load it onto your Arduino and make a note of the serial port you used. You will need to use it below with AVRDude.
- Check the heartbeat is working. If it ever stops when AVRDude isn't running, hit the reset button.
- Install or locate WinAVR.
- Load the sketch you want to put on the ExtraCore
- Hit the "verify" button. This will compile the sketch to a .hex file.
- 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)).
- Open a command prompt. (Start->cmd.exe)
- Use the CD command to change to the WinAVR bin directory. (remove quotes) "CD C:\winavr\bin" for example.
- 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.