;*************************************************************************** ; Application: Led flasher ; Author: Dan Williams ; Date: ; Assembler: AVR Studio 4.07. ; Target: Atmel ATtiny13. ;*************************************************************************** ;------ objective ----- ;PB0 PWM1 ;PB1 PWM2 ;PB2 ANA2 ;PB3 SC ;PB4 SD ;PB5 ANA1 ; ;---- this test ----- ;PB0 LED1 ;PB1 LED2 ;PB2 LED3 ;PB3 SC ;PB4 SD ;PB5 LED4 ; ;**************************************************************************** .device ATtiny13 ; ------------- Memory locations --------------- ; ; .def bar =r01 ; one byte ram location ; ; ---------------------------------------------- ; R 0 ->15 are gen. purp. .def A = r16 .def B = r17 ; and logic instructions .def C = r18 .def D = r19 .def curstate = r20 .def laststate = r21 .def i2cin = r22 .def bitcount = r23 .def i2cstat = r24 .def curbyte = r25 .def _V = r26 .def _w = r27 .def _X = r28 .def _Y = r29 .def _Z = r30 ;cant use r25 -> r31 ; ------------- Equates ------------------ .equ TRUE = 1 .equ FALSE = 0 .equ INPUT = 0 .equ OUTPUT = 1 ; --- Port Directions --- .equ PB0DIR = OUTPUT .equ PB1DIR = OUTPUT .equ PB2DIR = OUTPUT .equ PB3DIR = INPUT .equ PB4DIR = INPUT .equ PB5DIR = OUTPUT ; --- Initial port state --- .equ INPB0 = 0 .equ INPB1 = 0 .equ INPB2 = 0 .equ INPB3 = 0 .equ INPB4 = 0 .equ INPB5 = 0 ; --- Port Names --- .equ LED1 = 0 ; start / stop .equ LED2 = 1 ; 1 / 0 .equ LED3 = 2 ; .equ SC = 3 .equ SD = 4 .equ LED4 = 5 ; RESET ; --- amalgimate --- .equ INITDIR = ((PB5DIR<