Fixing the Firefox 4 open tab / open window nonsense

April 15, 2011

Firefox 4 has got it into its head that tabs are better than windows, despite the fact that tabs use up more UI and look ugly, while windows are nice and clean.

In order to promote their tab agenda, they’ve changed the order of the context menu so your muscle memory for “Open Link in New Window” now brings you “Open Link in New Tab”. Ugh.

Luckily, there is an answer for this.

Create a userChrome.css file in your profile/chrome directory (on Windows, C:\Documents and Settings\user\Application Data\Mozilla\Firefox\Profiles\somethingrandom.default\chrome\):

#contentAreaContextMenu > * {
-moz-box-ordinal-group: 2;
}
#context-openlink {
-moz-box-ordinal-group: 1 !important;
}

This doesn’t change the order under the file menu, but at least when you’re using the context menu it will work right.


Upgrading the Arduino Uno 8U2 using Fli

April 14, 2011

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:

  1. Install Flip from the Atmel webpage. If you don’t already have a JRE, you probably want the 20 megabyte package that includes one.
  2. 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.
    
  3. 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.
  4. Hook up wires and touch them to the right spots on the Uno at the right time as described in this Arduino forum post by pluggy.

    Update: Pluggy’s image has disappeared. Here it is:
    flasheo8u2-1-300x216
    I found it at www.ardumania.es/reflashear-el-8u2/.

    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!

  5. 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.
  6. When the Windows device installer comes up, select “have disk” and install the Atmel USB driver. By default the Atmel USB driver is installed in C:\Program Files\Atmel\Flip 3.4.2\usb\atmel_usb_dfu.inf
  7. Notice that the driver is AT90USB82, not ATmega8U2
  8. Although it tells you that you have to reboot XP when you install the driver, I didn’t bother.
  9. Start Flip from the Program menu
  10. File->Load HEX file->Arduino-usbserial-uno.hex
  11. Device->Select->AT90USB82
  12. Settings->Communication->USB and press Open
  13. At this point, you should be ready to program. Press the “Run” button on the main screen.
  14. Programming is quick, taking about 4 seconds. After it’s done, remove the two wires you put in earlier, then unplug the USB cord and reinsert it.

Once you’ve done that, your Uno should be out of DFU mode and back into normal mode.

You can go to My Computer->Manage->Device Manager->Ports (COM & LPT), right-click on “Arduino UNO” and select “Properties”. Under the Details tab, Firmware Revision should now be 00.01.

Update: Someone mentioned they couldn’t find the atmel_usb_dfu.inf file. Looks like there’s a copy here.


Testing the USBtinyISP on Arudino Uno

April 9, 2011

After building a USBtinyISP programmer to burn new bootloaders to my Uno (and other devices) I wanted to test it before putting it in the case.

Unfortunately, the obvious place talks about programming with WinAVR and other random things that you don’t care about when you’re hot to see if the thing actually works.

Here’s what I did instead (using a Windows XP machine, since that is what’s claimed to cause the least trouble):

  1. I downloaded the USBtinyISP drivers and unzipped them into a directory.
  2. 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.
  3. 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”.
  4. 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.

  1. 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.)
  2. Then I made sure the jumper on the USBtinyISP was off (not supplying voltage).
  3. Next, I plugged the USBtinyISP into my USB port and verified that the green light came on.
  4. After that, I plugged in my Uno (to a different USB port) so it was getting power and was recognized.
  5. Finally, I went to the Arduino IDE and did Tools -> Burn Bootloader -> w/USBtinyISP.
  6. 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.