# avrciczz Programming Tutorial

## Requirements

- ATtiny13a Microcontroller
- IC Programmer (for example: MINIPRO 866)
- avrciczz.hex file

avrciczz.hex file on krikzz's GitHub [HTTPS]

## Tutorial

- Insert ATtiny13a into IC programmer
- Select ATtiny13a in IC programmer software
- Open avrciczz.hex file in IC programmer software
- Write to ATtiny13A
- Set Fuse High Byte to 0xFB (see Fuse High Byte Data below)
- Set Fuse Low Byte to 0x70 (see Fuse Low Byte Data below)
- Write to ATtiny13A again

## Minipro Commands

    minipro -p attiny13a -w /path/to/avrciczz.hex

    echo "fuses_lo = 0x70\n \
          fuses_hi = 0xfb\n \
          lock_byte = 0xff" | minipro -p attiny13a -c config -w-

### Fuse High Byte Data (0xFB)

- Bit 7 = Unchecked (1)
- Bit 6 = Unchecked (1)
- Bit 5 = Unchecked (1)
- SELFPRGEN = Unchecked (1)
- DRWEN = Unchecked (1)
- BODLEVEL1 = CHECKED (0)
- BODLEVEL0 = Unchecked (1)
- RSTDISBL = Unchecked (1)

### Fuse Low Byte Data (0x70)

- SPIEN = CHECKED (0)
- EESAVE = Unchecked (1)
- WDTON = Unchecked (1)
- CKDIV8 = Unchecked (1)
- SUT1 = CHECKED (0)
- SUT0 = CHECKED (0)
- CKSEL1 = CHECKED (0)
- CKSEL0 = CHECKED (0)

## Making the programmed CIC chip work

When the NES cartridge PCB with an avrciczz programmed ATtiny13a installed into it is played on an official front-loader NES console (NES-001) with a functioning lockout chip, the cartridge will be rejected initially. This is shown by the console resetting over and over again. avrciczz allows the ATtiny13a to function as the lockout chip for many regions.

To make the avrciczz programmed ATtiny13a work in that console's region, press the reset button 4-7 times (I usually press it at a rate of about 3 times a second until and after a few seconds see if the console's LED indicator light stays solid). This process cycles through the different regions until the console successfully pairs with the avrciczz programmed ATtiny13a, at which point that ATtiny13a will remain that region. If you place that cartridge in a different region front-loader NES, you will need to do the reset button method again to pair it to that console's region.