UNO as ISP programmer

So, you have bought some ATtiny88 breakout boards online. They are advertised as Nano equivalents but are inferior to the Nano in having low RAM (512 bytes vs 2048) and missing some other features. Specifically, the lack of a USB comport for programming.

The ATtiny88 USB interface only works in the Arduino IDE with some tweaking, and you are not in the mood for learning how to write sketches after being in the GCB environment for years.

This is an all-in-one tutorial for programming the ATtiny88 via AVRdude using GCB.

Note

The only baud rate that works is 19200. Every other baud rate failed in testing.

The process described will create a new programmer entry in the GCB Programmer Options to fully automate the compile and program process.

Note

This refers to an ATtiny88, but you can use this method for many AVRs used in conjunction with AVRdude.

The Process

  1. Obtain an Arduino UNO or Mega. Upload this hex file to convert the UNO into an ISP programmer, or follow steps 2-5 below.
  2. Download the Arduino IDE software. This is used to upload a sketch to the UNO that converts it into an ISP programmer.
  3. Connect the UNO to your PC via USB. In the Arduino IDE, go to Tools → Set board and select "Arduino UNO". Select the correct com port for the Arduino UNO, as shown in Device Manager.
  4. Go to File → Examples → ArduinoISP to select the sketch that will convert the UNO to an ISP programmer. A better-working version is available at Adafruit. Simply copy all the text from this link into a new sketch, ArduinoISP.ino (or download the ino file and open it in the Arduino IDE), and go to step 5.
  5. Click upload and confirm the sketch uploaded correctly by checking the status window at the bottom of the Arduino IDE.
  6. Build a cable to connect the ISP headers on the UNO and target (ATtiny88) board as described below. Search online for the UNO ISP header pinout - the ISP header happens to be labelled underneath the ATtiny88 breakout board.
  7. Connect pin 10 of the UNO to the reset pin on the target ISP header.
  8. Connect VCC to VCC, MOSI to MOSI, MISO to MISO, GND to GND, and SCK to SCK.
  9. Open SynWrite → "IDE tools" → "GCB tools" → "Edit Programmer preferences", or, in GCStudio, "Edit Programmer preferences".
  10. Click "add" and a program editor window opens.
  11. Enter the name "Arduino as ISP" or similar.
  12. In the "Use if" box, paste DEF(AVR).
  13. In the "File" box, paste %instdir%..\avrdude\avrdude.exe.
  14. In the "command line parameters" box, paste -c avrisp -p t88 -P %Port% -b 19200 -U flash:w:"%FileName%":a.
  15. Select the com port that corresponds to the connected UNO port.
  16. Click OK.

Enter the sample code below into the GCB IDE

    #chip tiny88, 12

    dir PORTD.0 out

    Do
      set PORTD.0 on          ' <<< the Set instruction turning the LED on
      wait 500 ms
      set PORTD.0 off
      wait 500 ms
    Loop

Key line: set PORTD.0 on — drives pin D.0 high, lighting the LED for 500 ms before the loop turns it back off, producing a one-second blink cycle once flashed via the Arduino-as-ISP programmer configured above.

Now you can select "Hex/Flash" to upload the code to the ATtiny88. If all goes well, the LED should blink on and off every second.

See Also: