Thursday, July 24, 2014

Part 2- Fixing a failed 3D printer controller board

Building the AVR Programmer

In my previous post, I explained the printer problem I am having and how I planned to fix it using an AVR programmer. Most of the methods I found on-line for re-programming a Rev D Printrboard make use of a "USBtinyISP AVR Programmer" from Adafruit (image below is from their website):
This device comes in kit form, and as an open-source design, the schematics, drivers, and applications are readily available. I have built several other Arduino shield kits from Adafruit which worked well, so felt confident this would be a good choice (I do have one concern based on a comment on Amazon regarding interfacing to 3.3 volt devices, but I'll discuss that later). 
The direct order cost with 3-day shipping from NYC to Boston came to less than $32.

Assembly

Like most Adafruit kits, this came in a padded envelope as a bunch of parts in an anti-static bag:
There are no printed instructions provided, but instead the bag has a label that gives the URL to an excellent tutorial on the web. As I have done in the past, I downloaded the guide in PDF format so I could view it on a tablet and easily zoom in to look at images of the parts while I am working.
The Version 2 of this AVR programmer has several nice features:
  • Low cost: you could breadboard one up for less than $16.
  • All through-hole design (rather than surface-mount) makes for easy assembly.
  • Case with indicator LEDs.
  • Supports both 6-pin and 10-pin bus connectors.
  • Pre-programmed/socketed microcontroller which simplifies repair.
  • Ability to program a target which is running at voltage other than the standard USB +5 volts (maybe...).
It took me about an hour to assemble the USBtinyISP; I also installed the 'JP3' jumper so that it can supply +5 to the target device being programmed. To test it, I had to load some software onto my laptop. 

Windows Drivers

Windows drivers for the USBtinyISP are available from Adafruit; I downloaded the zip file for Win7-64 and unpacked it into a local folder on my laptop. I then connected the assembled USBtinyISP to the laptop with a USB A-to-B cable. The green LED on the programmer came on and I got the pop-up for installing a new driver:
Instead of letting Windows Update search for new drivers, I selected the option to install from the folder I put the downloaded driver into. Although the Win7-64 driver was unsigned, it installed just fine:
So what's next?

AVR, Dude!

Well, actually "WinAVR" (pronounced "whenever"), which includes the interface program "avrdude" (AVR Downloader Uploader: a program for downloading and uploading the on-chip memories of Atmel’s AVR microcontrollers).
I installed the latest version of WinAVR onto my laptop (avrdude 5.5 and newer has support for "usbtiny"; get it here)  and then followed these instructions to test my USBtinyISP.
  • On the Win7 laptop, open a 'cmd.exe' window and type the command 'avrdude' to see if the program installed correctly:

  • Next, type the command again with options to specify the programmer and the target chip:
    • > avrdude -c usbtiny -p at90usb1286
  • Success! It communicated with the programmer! (but did not find a connected chip)
In the next post, I will hook up the Printrboard and see if it can be fixed.

No comments:

Post a Comment