How to: FabTinyStar Programmer

actual boardThe FabTinyStar is a small ISP programmer for AVR chips started at FabLab Amsterdam. You can use it with AVRdude or even from within the Arduino IDE. It is a super cool little USB programmer for AVR chips. You will need something to program this programmer with, so if you happen to have an Arduino that uses the FTDI chip for serial communications, you’re in luck because you can use that as a programmer (just match up the pins on the connector headers) to get the  FabTinyStar up and running. Typically a FabLab has one or two “professional” AVR programmers, then each student builds their own FabISP or FabTinyStar.

The FabTinyStar has gone through multiple revisions, so I’m showing only what I have tested and got working. Zaerc has a good multipart tutorial on FabTinyStar version 12 as well.

Why would you want to use this over the regular FabISP?

  1. Fewer parts (no crystal)
  2. No need to desolder or break off any jumpers after you burn the FabTinyStar Firmware, simply burn the fuses and you are ready to go
  3. It has a switch to power the target board (no need to use external power for the target board)
  4. It has an LED to show that it is connected and powering the target board
  5. It has an LED to show it is programming correctly. This little bit of feedback is awesome for debugging!
  6. The neat-factor of having an 8-pin awesome custom AVR programmer.

To build this device, you can download all of the EagleCAD files and Firmware here. You can use a variety of PCB fabrication techniques to make your own boards. I’ll leave that part up to you. I milled my PCB but you can etch it just as well.

Below I’ve shown the header pinouts for the ISP pins. I recommend you leave off the bottom two pins of the header (USB D+ and USBD-) because if you solder them on there, you can’t use the regular 6-pin header for programming or connecting up circuits.
fabTinyStar-013_lay

Firmware:

In Windows machines, I install the Arduino IDE which will come with AVRDUDE. Search through the installation folders of the Arduino IDE to find the AVRDUDE executable program.  I then typically use AVRdudess or another AVRDUDE GUI to program it using the following settings:

 

FabTinyStar Drivers:

Before using the FabTinyStar, you must install the appropriate driver in Windows. There are a couple of good guides out there (namely the one on Adafruit) but the one that is closest to the FabISP you just built is here at Sparkfun. Following that guide will install the drivers. To check this driver is recognizing correctly, open the device manager in windows and confirm that “libusb-win32 devices–>USBTiny” appears (and disappears when you remove the device).

When using the FabTinyStar, you might need to flash the target chip multiple times, or you might get a “verification error.”

Installation was simple, but not being super familiar with windows, I hit a couple of stumbling blocks. Here are the steps I got to work on Windows 7.

  1. Download the Windows driver for USBTiny (which the FabISP is a type of)
  2. Unzip the folder to the desktop or somewhere accessible.
  3. Plug in the FabISP
  4. Start–> control panel–> hardware and sound –>Device Manager
  5. Once here, right click on the FabISP icon in the “unknown devices” tree
  6. Select “update driver”  or something to that effect
  7. Select the option to manually select the folder the driver lives in and locate the driver to install it.
  8. Also, install the ATtiny hardware files:  Download them here, and unzip them into your ~/My Documents/Arduno folder.
  9. I also manually added “FabISP” to my programmer.txt file.  You *could* just select “USBTiny” in the Arduino Tools–Programmer menu, but I wanted mine to say “FabISP”.
  10. So when you are ready to test this, open the Arduino IDE, select File–>Examples–> 01Basics–> Blink
  11. Change the pin number on line 10 to the one you LED is connected to (Arduino doesn’t use “PORTB.1” for instance, so look at the map at the bottom of this page to see what number your pins are.  You can use that type of addressing if you want, but most Arduino programs don’t).

 

Using this programmer with custom-built AtTiny circuits in Arduino.

The following is a quick summary of this page at HighLowTech to serve somewhat as a mirror, but mainly as a cheatsheet on how to setup and use AtTiny chips with the FabISP in theArduino IDE..

You can use these programmers in the Arduino IDE to program your boards directly, without using the Arduino bootloader on the target chips.To use Arduino IDE, you can install the AtTiny board library from HighLowTech. I don’t use the built-in function for add-on in Arduino’s IDE because it has never worked for me on any machine I’ve tried it on. Typically, I find it easiest to simply download the Arduino library for 1.6.x  (here’s my copy as a backup) and install it manually by copying the “attiny” folder in the zip file to my arduino’s hardware preferences folder. On my machine this is the path: C:\Users\ALaptop\Documents\Arduino\hardware. I had to create the “hardware” folder inside “Arduino”, but then I just restarted the Arduino IDE and could see the change had taken by finding Tools–>Boards–>AtTiny.)

On Mac or Linux, find the Arduino IDE installation and copy the library to the hardware folder.

How to use this new library:

Restart Arduino (or open it if you hadn’t already) and select “Tools–> Boards”  and now you should see a AtTiny entry.   I’m showing what it looks like in Arduino 1.6.4.  Different versions might look a little different, but you should be able to get the same results pretty easily.

board

Once you select “AtTiny” as the board, you will see different options under “processor”.  Select the chip you are using here.

Chip

 

After selecting the particular chip, you can select the clock frequency and whether it is internal or external. If your design uses a resonator or crystal, it is external.

clock

Also, when you select “Tools–> Programmer” you should see “USBTiny” listed.  Select that as well.

programmer

The first time you connect a particular AtTiny chip to this setup, you’ll need to burn the fuses.  The way to do that is plug your USBTiny into the computer, plug your target board (your custom design with an AtTiny) into the USB Tiny, Select the appropriate Chip, Board, and Crystal.  Then select Tools–>Burn Bootloader.”  After this is done, just the target board is ready to accept the arduino code you write.

bootloader

Not all functions of arduino are possible since the AtTiny series chips have fewer capabilities, but most stuff works fine. If you want to drive servos easily with the AtTiny chips, you can use the 8-bit servo library found here

Keep in mind the following pinouts for the AtTiny 44 and AtTiny45 (or 84/85) when writing your arduino code.

ATtiny45-85

ATtiny44-84

Photo Credit: All glory goes to High-Low Tech

Testing it out:

echoHelloWorldFlashy

You can build a simple multi-use board I made as an example.  Download the EagleCAD files and Arduino code for that project here. I originally made the PCB and the code for my FabAcademy page. Check those links for more detailed info.

Open the Arduino IDE and start a new project. Paste the following code in it and set it up to program an AtTiny44 with a 20MHz external clock. PLug in your FabTinyStar, connect the example board and compile and download the code.:

 

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(7, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.