; bulb - BlinkenArea ultimate logo board
; version 1.1.0 date 2012-06-10
; Copyright (C) 2011-2012 Stefan Schuermans <stefan@blinkenarea.org>
; Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
; ATtiny2313A, clock frequency: 8 MHz (internal oscillator)
; PA0: unused
; PA1: unused
; PA2: reset
; PB0: column 0 output (output, low)
; PB1: column 1 output (output, low)
; PB2: column 2 output (output, low)
; PB3: column 3 output (output, low)
; PB4: column 4 output (output, low)
; PB5: column 5 output (output, low)
; PB6: column 6 output (output, low)
; PB7: unused (input, pull-up enabled)
; PD0: row 0 output (output, high)
; PD1: row 1 output (output, high)
; PD2: row 2 output (output, high)
; PD3: row 3 output (output, high)
; PD4: row 4 output (output, high)
; PD5: row 5 output (output, high)
; PD6: mode switch (input, pull-up enabled)
.INCLUDE "tn2313def.inc"
; IO pins
.equ COL_PORT = PORTB ; column outputs
.equ ROW_PORT = PORTD ; row outputs
.equ MODE_SW_PIN = PIND
.equ MODE_SW_BIT = 6
; general purpose registers
.def TMP = r16
.def CNT = r17
.def DATA = r18
; current mode
.def MODE = r19
.equ MODE_ALL = 0 ; play all animations
.equ MODE_SINGLE = 1 ; play single animation only
.equ MODE_UNKNOWN = 0xFF ; unknown mode