Skip to content

Programming

Joel Ray Holveck edited this page Dec 9, 2018 · 1 revision

The microprocessor is an ATtiny84A, which can be programmed using the Arduino IDE.

ICSP Programmer

You need to use an ICSP programmer, since the ATtiny84A doesn’t have enough flash space for a bootloader. The USB data lines on the Christmas tree board aren’t even connected. Important: You must use a 3.3V-compliant ICSP programmer! Using a 5V programmer probably won’t damage anything, but the board is not designed for it. I prefer the USBtinyISP from https://www.adafru.it/46 . You can also use a 3.3V Arduino (such as a Due or Zero) as an ICSP.

ICSP Cable

For the cable, you have three options: Use a Tag-Connect connector such as the TC2030-IDC on J2 (this is what I do) Solder a standard 6-pin 0.1” header on J3 Use a pogo pin connector such as http://sfe.io/p11591 on J3 Whether you’re using J2 or J3, the pinout is the standard Arduino ICSP pinout.

  • 1: MISO
  • 2: VCC (3.3V, supplied by Christmas tree board)
  • 3: SCK
  • 4: MOSI
  • 5: RST#
  • 6: GND

Configuring the Arduino IDE

You’ll need to install the ATtiny84A board support package from https://github.com/damellis/attiny. This might work with other ATtiny BSPs, but I’ve only used that one. Important: Configure the clock (in the Tools menu) to 8 MHz internal. Configuring an external clock will brick your ornament! (It can be recovered by connecting the crystal from an Arduino across pins 2 and 3 of the ATtiny84A, but that’s annoyingly difficult.) You’ll need to program the configuration fuses in the ATtiny84A, but only once. Since the Arduino IDE doesn’t support programming the brown-out fuse, you’ll need to use avrdude on the command line to program the fuses; until you do, you’ll get a POST error. The command line is: avrdude -p t84 -c usbtiny -U lfuse:w:0xe2:m -U hfuse:w:0xdd:m -U efuse:w:0xff:m

Clone this wiki locally