AVR HV Rescue Shield Out of Stock

This week I sold the last AVR HV Rescue Shield kit in stock! This is a significant milestone as it means I have finally sold off all of the kits from the original PCB fab run. At the time I wasn’t sure if anyone would actually buy such a thing, so pulling the trigger on what seemed like a huge number of boards was a leap of faith!

I want to thank everyone who bought kits and PCBs. Thank you for supporting me and the site!

Rather than reorder new boards of the existing design, I am taking this opportunity to re-evaluate my approach to a couple things, with the goal of reducing the BOM cost and lowering the overall cost of the kit.

The bad news is that this means there won’t be any more kits in stock in the short term. I’m planning to release a new PCB design within the next couple weeks, which means kits would be in stock within about a month. Because this is a busy time for me, I can’t promise specific dates, but I will do my best to keep the process moving because I know there are people waiting for the new kits.

If you need a kit right now, I believe Solarbotics still has some in stock.

Otherwise, stay tuned for updates.

And again, if you bought a kit, or even if you built the DIY version with spare parts and helped spread the word, thank you!

– Jeff

Improved firmware for USBTinyISP fixes USB issues

I am a big fan of VirtualBox.  I have used it in various forms over the past couple years: to run Windows within Linux, Linux within Windows, Linux within OSX, Windows within OSX, etc.  It is fast, powerful, configurable, and best of all, free.

However, there is one major disadvantage to using a virtual machine for hardware development.  Sometimes USB devices don’t get along with the VM very well.  What’s worse is that sometimes certain combinations of host and guest OS will work for a given USB device, while others won’t.  This can make debugging very frustrating!

I recently set up VirtualBox on my Windows 7 x64 PC so that I could run Ubuntu 10.04 alongside Windows.  Everything was going great until I plugged in my Adafruit Industries USBTinyISP so I could flash an AVR from within the Ubuntu virtual machine.

Instead of seeing the USBTinyISP show up on the VM, I got something like this:

The USBtinyISP is shown as “State: Captured:” in the VirtualBox USB device menu but there is no checkmark along side it, it doesn’t show up in lsusb, and avrdude can’t find it either.

When I tried to attach the USBtiny in Virtualbox again, I got this error message:

Bad news.

I tried various combinations of relaunching VirtualBox, rebooting, adding USB filters to the VM, unplugging, replugging, etc.  No dice.

I decided that there must be an issue with the USB stack running on the USBTinyISP.  Most USB devices can handle the hand-off between the Windows host and the Ubuntu virtual machine, but for some reason the USBTinyISP can’t.  (It’s also worth mentioning that the Atmel AVRISP mkII programmer doesn’t work with Virtualbox either.  It shows up but can’t flash a device.  I’ll have to look into this someday, but since I mainly use the USBTinyISP, fixing the AVRISP wasn’t a priority.)

The firmware that powers the Adafruit USBTinyISP is based on Dick Streefland’s usbtiny project.  Dick has released a couple more revisions of his code since the v1.3 release that Limor Fried used to create the USBTinyISP v2.0 firmware.  There have been a few bug fixes and improvements to the code, including some that address USB enumeration/communication issues.  In addition, the usbtiny code now includes a branch specifically for the USBTinyISP.  A pre-compiled hex file is provided for easy flashing to an ATtiny2313.

I was hopeful that these fixes might solve my Virtualbox problems, so I downloaded Dick’s new usbtiny-1.5 source and used my spare AVRISP mkII (within Windows) to burn the main.hex file to a spare ATtiny2313.

Flashing ATtiny2313

The USBtinyISP source sets the fuses on the ATtiny2313 for an external clock, so  I had to wire up a ceramic resonator (small orange blob to the lower left of the AVR) to verify the AVR after setting the fuses.  You can see my Sparkfun AVR ISP adapter on the right.  I also wired up  an external 5V power supply (the test leads at the top of the breadboard).

After burning the new usbtiny-1.5 firmware to the ATtiny2313, I installed it in my USBTinyISP and connected it to my computer.

At first, I still couldn’t get the USBTiny to attach to the VM if I plugged it into my PC and then selected it from VirtualBox’s USB menu.

However, when I created a USB filter in VirtualBox for the USBTinyISP and restarted the VM, it started working!  This was a huge improvement over the original firmware, which never worked once, despite all of the combinations I tried!

Here is the USB filter setup, accessible from the VM settings:

Note that the revision is now shown as 0105 (instead of 0104 with the old usbtiny firmware):

lsusb shows the USBTinyISP (1781:0x9f Multiple Vendors) and avrdude no longer complains about finding the programmer.  (The initialization failed message shown below is because I didn’t have an AVR connected.)   The red LED on the USBTinyISP flashes when I run avrdude – a sure sign that the VM is communicating with the programmer.

Here is my modified USBTinyISP, with the reflashed ATtiny2313 and shorted R4 & R7 (handy for programming devices that try to pull up/down the SCK/MOSI lines!)

Modified USBTinyISP

I hope this helps anyone else who is trying to get the USBTinyISP working in Virtualbox on Windows.  It may help solve other USB problems as well – the fixes in the newer usbtiny code may apply to other situations as well.  If you are having problems with USB and the USBTinyISP, try upgrading the firmware and post your results here!

Budget mini-ITX home server build

Atom

For the past three years, I have been using a Linkstation Live for my home server.  When I bought it, it seemed ideally suited to my needs – it’s small, consumes under 30W full-load, and can be hacked to run Linux (I was running Debian).  It’s primary purpose is to serve files (functioning as a NAS device, as Buffalo intended), but I also use it for some more interesting things, such as hosting a subversion repository, serving music with mt-daapd, and managing a small VPN.

I started outgrowing the ARM9-based Linkstation at least a year ago – it was bogging down under the load of the many services it was running.  However, earlier this year Debian Etch became unsupported, meaning that I was no longer receiving security updates – a potentially major problem for a server that has a few ports open to the ‘net.

I started thinking about building a replacement using more modern, faster parts, but still keeping the server’s footprint small – both in terms of space and energy consumption.

After doing some research, I discovered the mini-ITX standard for motherboards and the Intel Atom D510 dual-core processor.  When combined with the right case, these would yield the perfect home-server for my needs.

Here’s my build list.  All parts are from Newegg.com:

Foxconn RS233 Black+Light Silver Computer Case – $44.99 (includes 150W PSU)

Intel BOXD510MO Intel Atom D510 Mini ITX Motherboard/CPU Combo
– $79.99

PQI POWER Series 2GB 240-Pin DDR2 SDRAM DDR2 800 (PC2 6400) Desktop Memory
– $38.99

HITACHI Deskstar HD31000 1TB 7200 RPM SATA 3.0Gb/s 3.5″ Internal Hard Drive – $64.99 (no longer listed @ Newegg)

SAMSUNG Spinpoint F3 1TB 3.5″ SATA 3.0Gb/s Internal Hard Drive -Bare Drive – $58.99 (a good substitute)

StarTech BRACKET Metal 3.5″ to 5.25″ Drive Adapter Bracket – $11.99
(For mounting a 2nd hard drive.)

Athena Power 10 ” Extension & Conversion Four-In-One9
– $6.99

Xion XON-DRBY525MB 5.25″ Driver Bay Cover Kit, Mesh, Black
– $9.99

Note: Prices listed are current as 9/17/10 and are subject to change.

The total for all parts at the time I bought them was  just under $250 (excluding shipping).  Not bad!  As of today (9/17/10), the prices have gone up slightly and the total is $257.93, although the Hitachi hard drive I bought has already been discontinued.   Newegg frequently has deals on 1TB 3.5″ drives, so finding another one in the $55-$65 range should be pretty easy if you look around.

Here are most of the parts waiting to be assembled:

New server parts

I spent a lot of time looking for a case, and I’m extremely happy with the Foxconn RS233 Mini ITX case I found.

Foxconn RS233 Mini ITX case

Everything fit very nice inside, including a 2nd 3.5″ hard drive I had lying around that is used for backups.  (The 2nd hard drive is installed in the 5.25″ bay, using adapter brackets.)

I added a short power supply extension cable to the motherboard power connector.  This is because the 150W PSU that comes with the Foxconn case has a short power cable that can’t reach the motherboard power connector without stretching.  It can be forced to fit, but the extension was inexpensive and gives me some peace of mind.

New power cable routing

I initially had some problems with hard drive temperatures, but installing this clean-looking grill in place of the 5.25″ bay cover solved that.  For testing, I just left the cover off the bay completely, which provides great ventilation but allows cat hair to rapidly collect inside the case.

Grill installed

I also covered the case’s top vent to keep the exhaust fans from sucking air through there instead of through the front of the case (past the hard drives and CPU).

Top vent sealed

Here is the finished server.  It’s small!

Finished

I spent a couple evenings installing and configuring Ubuntu Server 10.04 LTS, which I am very happy with so far.  It did force me to learn how to completely install and configure Ubuntu via the command-line (Server doesn’t install a GUI), but it was all stuff I mostly knew already, and I probably gained some geek-cred.  😉

While I still have a few things left to set up (OpenVPN takes a bit of configuring), I’m very happy with the performance of this box.  While a dual core Atom is nothing compared to a typical desktop machine today, this machine is lightning-fast compared to the 200MHz ARM9 it replaced.  For a small home server, this is a perfect solution.

Power consumption is about 35W with both drives spinning, about 30W idle.  Just a few watts more than the Linkstation, for a system with >1.5GB more memory and what feels like 10x the processing power!

AVRISP mkII libusb drivers for Windows 7 / Vista x64

Continuing on the theme of my last post, here are libusb-win32 drivers for the Atmel AVRISP mkII. Unlike the Atmel-supplied drivers, these support avrdude, and as a bonus they will install on the 64-bit version of Windows 7 without digital signature errors. Yes!

avrispmkii_libusb-win32_1.2.1.0.zip

Note that if you want to use the AVRISP mkII with AVR Studio, these are not the drivers you are looking for. You want the ones Atmel provides (if you installed the libusb drivers by mistake, re-run the AVR Studio installer to revert back).

Fixed USBTinyISP drivers for 64-bit Windows 7 / Vista x64

For some time now, those wanting to use the Adafruit Industries USBTinyISP with the 64-bit versions of Windows 7 or Vista were faced with the following errors when attempting to install the device drivers supplied by Adafruit:

For some reason, the 32-bit versions of these operating systems don’t prevent the unsigned drivers from being installed, although they do complain.

There are a few workarounds that involve hacking Windows or disabling digital signature checking, but thanks to a tip by user wayneft on the Adafruit support forums, I was able to make the process much more straightforward.

The USBTiny drivers are based on libusb-win32.  Based on some notes I found on the libusb-win32 wiki, I discovered that the latest libusb drivers contain a proper digital signature:

Vista/7 64 bit are supported from version 1.2.0.0 since a Microsoft KMCS accepted digital signature is embedded in the kernel driver libusb0.sys. libusb-win32 based device drivers can also be submitted for Microsoft WHQL testing. Several companies have successfully finished the WHQL testing with their libusb-win32 based driver package. This will allow the customers to install the driver without a warning under current 32bit/64bit Windows.

This is good news!

I downloaded the latest version of libusb-win32 (1.2.1.0) and used the included inf-wizard tool to create new drivers for the USBTinyISP:

usbtinyisp_libusb-win32_1.2.1.0

I used the Windows device manager to upgrade the broken drivers on my Windows 7 64-bit machine.  There is still a warning that “Windows can’t verify the publisher of this driver software” but there are no more errors about digital signatures and the new drivers appear to install and work correctly.

I haven’t done a huge amount of testing with the drivers, but I was able to communicate with the USBTiny via avrdude and flash a simple program to an AVR.   I also haven’t tested this fix on Vista, as I don’t have access to a computer running it.  If anyone tests these drivers on Vista x64, please post your results in the comments!