I recently upgrade from the 1.0.5 version of the Arduino IDE to 1.6.1. Things aren’t completely smooth – in particular, I was using Coding Badly’s cores for ATtiny85, ATtiny84 and ATtiny2313.

Unfortunately, those haven’t yet been updated for the new layout specified in the 1.6.x IDE. So instead I switched for now at least to the damellis cores (which support ATtiny85 and ATtiny84, but not ATtiny2313/4313).

Installing this is a matter of unzipping it in the sketchbook/hardware folder (on my Windows box in C:\Users\{my user}\Documents\Arduino).

The instructions on the Arduino DFU update page are pretty vague when it comes to updating to the latest firmware using the Atmel Flip utility. Here’s what I did to get my Uno 8U2 firmware updated using Windows XP:

Install Flip from the Atmel webpage. If you don’t already have a JRE, you probably want the 20 megabyte package that includes one.

Download the 8U2 firmware. That’s the “Arduino-usbserial-uno.hex” file. The “UNO-dfu_and_usbserial_combined.hex” is the Arduino Uno bootloader firmware for the 328p. If you try installing the 328p firmware onto the 8U2 in Flip, you’ll get an error dialog:

class com.atmel.flipGui.FileMenuHandler
Address is out of range.

I ended up cutting & pasting the hex file contents into a text editor because I couldn’t figure out how to download a single file from github, and I didn’t want the whole 200 megabyte wad.

You’ll know you did it right when Windows detects a new device. It took me a few tries to keep the first wire steady enough when touching the second wire. Make sure you’re going to the right pads – you could short out your Uno if you touch the wrong place!

After Windows detects the new device, you don’t have to hold the wires in place any more. Move them to the side so you don’t accidentally short out something.

I plugged the USBtinyISP in (before putting the programming cables / case on yet). It was recognized as a USB device, and I installed usbtinyisp.inf from the unzipped driver.

I immediately tried to talk to the device using the Arduino 022 IDE and “Burn Bootloader -> w/USBtinyISP”. It failed with the error message “Could not find USB device 0x1781/0xc9f”.

So I unplugged the device and plugged it back in. This time I got “Initialization failed, rc=-1” which is correct.

Whew, that meant my device was talking – in other words, I’d probably put it together correctly. Next was to see if it actually could program my Uno.

I plugged the 6-connector programming cable in. The red stripe went on pin 1 of the silkscreen of the USBtinyISP, and the pin with a dot on it on the programming header of the Uno. (At first it looked wrong, but when I turned the cable around it was fine. The cable goes across the whole length of the Uno.)

Then I made sure the jumper on the USBtinyISP was off (not supplying voltage).

Next, I plugged the USBtinyISP into my USB port and verified that the green light came on.

After that, I plugged in my Uno (to a different USB port) so it was getting power and was recognized.

Finally, I went to the Arduino IDE and did Tools -> Burn Bootloader -> w/USBtinyISP.

The red light came on for about two minutes to program my chip. After it turned off, I uploaded a sketch to make sure it worked – and it did. “Done burning bootloader.” Yay!

Finally, I put the 10-pin programming cable in and the case on. I had to push the LEDs around a little (the green one was getting pretty close to the USB header). Then I was able to snap the case on and catch my finger in there as well, removing a little skin I didn’t need.

That was it – I now had a good programmer. I did another program with the case on to make sure it worked and I hadn’t broken anything.

Next I’ll look on the Arduino firmware github page to see if there’s any newer boot firmware.

Why did these get removed from the Arduino C++ variant? On a device as limited as the ATmega328, it makes no sense to malloc() from a pool. Might as well just allocate the variables you want. (Or in my case, allocate an array of variables up front). That way, you know you don’t have a pointer leak that will hose you as you run.

Assembly and Power Up

Putting the Ardweeny together was pretty simple. One word of advice: you do not want to do this without a third hand tool. Even that won’t be enough for soldering the chip onto the headers – you’ll need a friend or some good gentle alligator clips to hold the chip while you do the first tack solders.

I powered it up by connecting +5v of the Ardweeny to +5v of the Serial USB board, and then connecting Gnd on the Ardweeny to Gnd on the Serial USB board. It started blinking right away – always a good sign.

Connecting to USB Serial

Connecting the Ardweeny to the Serial USB board was a little trickier. I used a pair of jumper wires. In one end of each one I stuffed a little clipping of 22 awg bell wire, so I had a female connector at one end and a male connector at the other.

Next, the big (and as far as I can tell undocumented) question: does TX on the Serial USB board go to RX on the Ardweeny and vice versa, or does TX on the Serial USB board go straight to TX on the Ardweeny? The answer:

TX on the Serial USB board (the pin furthest from Gnd on the left side) goes to RXI (the pin above A4 on the Ardweeny v1.1a)

RX on the Serial USB board (the pin just above +5v on the left side) goes to TXO (the pin above A3 on the Ardweeny v1.1a)

I hooked those up backwards and my USB port stopped recognizing the Serial USB board. I had to pull the Serial USB board from the USB hub and plug it back in to continue. (I’m doing all of this through a powered USB hub just to avoid burning out my motherboard’s USB if I make a mistake.)

Downloading Code

Once I’d done that, I sent a program down. The first program went with no problems after I set my COM port and chose the “Arudino Duemilanove or Nano w/ATmega 328”.

It turns out the Ardweeny is pretty particular about when things get uploaded to it. (This is where the auto-reset function of the FTDI basic breakout board shines, but I didn’t know that since I’d never done Arduino programming before.) So the magic trick to upload is to wait until you see:

Binary sketch size: 1018 bytes (of a 30720 byte maximum)

in the IDE, then immediately hit the reset button on the Ardweeny. At that point, you’ll see the TX and RX LEDs flash on the USB Serial board, and your code should be uploaded.