ATtiny85 Arduino Programming with Sparkfun Tiny Programmer on a Mac

This guide will help set up a Mac OS computer to program an ATtiny 85 using the USB Tiny AVR Programmer from Sparkfun and the Arduino IDE.

Required Items:

  • Sparkfun Tiny AVR Programmer (Sparkfun) – This is a handy USB based programmer for ATtiny microcontrollers. It is powered by an ATtiny84 that is set up as a USBtinyISP programmer. The board has an 8 pin socket to hold a ATtiny45/85 microcontroller that you want to program.
  • ATtiny 85 Microcontroller (Digikey) – The ATtiny85 is a low-power 8-bit microcontroller based on the AVR enhanced RISC architecture.
  • Arduino IDE (Download)
  • Mac computer (e.g. MacBook Pro) with OS 10.14 or later

I used the following steps to get the Sparkfun Tiny AVR Programmer working on my Mac. Hopefully this will be helpful for you as well. Your experience may vary.

Step 1: Install ATtiny85

Install the ATtiny 85 into the programmer. Make sure you orient the chip so that pin 1 (usually identified by a dot) is by the notch. Once this is installed, plug the USB into your computer. You will not see a light and Mac OS will not recognize it as a serial port (don’t worry).

Install ATtiny into Programmer

Step 2: Set up Arduino IDE

Install the Arduino IDE software (Download) and navigate the menu Arduino -> Preferences and in the field for “Additional Board Manager URL” paste this link:

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Click “OK” to save and restart the Arduino IDE. Navigate the menu Tools -> Board -> Boards Manger and type “attiny” into the top search board and there will click on the “Install” button on the attiny board package.

Find the attiny board package and Install.

You should now see an entry for ATtiny in the Tools > Board menu. Select “ATtiny25/45/85”.

For “Processor” select the chip you are using, e.g. ATiny85.

For “Programmer” select “USBtinyISP

For “Clock” unless you have an external crystal in your circuit, you should select “Internal” and 1 MHz seems to be fine for most projects.

Finish by clicking “Burn Bootloader“. You should see the LED on the programmer flash. If it doesn’t work, you may need to Quit the Arduino IDE and restart to try again.

Please note: On the Mac, you do NOT select a serial “Port”. The IDE will program the ATtiny through the USBtinyISP that is loaded on the Tiny AVR Programmer board.

Step 3: Program your ATtiny85

You can use the example blink test to make sure you can program your ATtiny85. You can use the built in blink test but you will need to change the LED_BUILTIN to be 0 (zero). You can also copy and past the following code:

void setup() {
  pinMode(0, OUTPUT);
}
void loop() {
  digitalWrite(0, HIGH);   
  delay(1000);                       
  digitalWrite(0, LOW); 
  delay(1000); 
}

Arduino 1.x IDE: Click the upload button (right arrow) or press Command-U.

Arduino 2.x IDE: Select Sketch > Upload Using Programmer or Shift-Command-U

Arduino 2.x IDE – Uses “Upload Using Programmer” or Shift-Cmd-U

Once uploaded, the built-in LED should start to flash.

Example “blink” program running on ATtiny85

The ATtiny85 has PWM (Pulse Width Modulation) outputs so you can use the analogWrite() function to adjust the brightness of the LED from 0 to 255. Here is an example that fades the LED.

/*
  Fade
  This example shows how to fade an LED on using the analogWrite()
  function.
  The analogWrite() function uses PWM, so if you want to change the pin you're
  using, be sure to use another PWM capable pin. On most Arduino, the PWM pins
  are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.
*/
int led = 0;           // the PWM pin the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 1;    // how many points to fade the LED by
void setup() {
  pinMode(led, OUTPUT);
}
void loop() {
  analogWrite(led, brightness);
  brightness = brightness + fadeAmount;
  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0) {
     analogWrite(led, 0);   
     delay(1500);
     fadeAmount = -fadeAmount;
  }
  if(brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  delay(10);
}

References

This was tested on Arduino 1.x and 2.x IDEs, on an Intel i7 based Apple MacBook Pro and on an M2 based MacBook Air using an USB-C to A adapter.