USBasp firmware for ATmega16, PD2/PD4 USB pinout
================================================

Base source:
  USBasp 2011-05-28 by Thomas Fischl

Target MCU:
  ATmega16
  External 12 MHz crystal

Working fuse bytes:
  LFUSE = 0xEF
  HFUSE = 0xC9

PonyProg checkbox note:
  PonyProg shows fuses inverted: checked means programmed bit = 0.

PonyProg checkboxes for LFUSE=EF:
  SUT0 checked.
  BODLEVEL, BODEN, SUT1, CKSEL3, CKSEL2, CKSEL1, CKSEL0 unchecked.

PonyProg checkboxes for HFUSE=C9:
  SPIEN, CKOPT, BOOTSZ1, BOOTSZ0 checked.
  OCDEN, JTAGEN, EESAVE, BOOTRST unchecked.

Pinout used by this build:
  USB D+  = PD2 / INT0
  USB D-  = PD4

  ISP MOSI = PB5
  ISP MISO = PB6
  ISP SCK  = PB7
  ISP RST  = PB4

  LED RED   = PC0, common cathode, active high
  LED GREEN = PC1, common cathode, active high
  SLOW SCK  = PC2, active low jumper to GND

USB wiring that worked:
  ATmega16 powered from 3.3 V.
  No Zener diodes on D+ / D-.
  D+ -> 68 ohm -> PD2
  D- -> 68 ohm -> PD4
  1.5 k pullup from D- to 3.3 V.
  USB GND and board GND common.

Build:
  cd firmware
  make main.hex

Known matching HEX:
  outputs/usbasp-atmega16-pd2pd4-pb4pb7-common-cathode-green-ready.hex

Matching HEX SHA256:
  1097E8E20E469427EC06FE1BF67D2FE92CACB0D19E9627BB7E9C50E2BC209691

