Assembly Language Source Code:
;
;W6MLP Blinkey - LED Chaser Effect
;Author: Chetan Bhargava - KG6NFG
;http://www.bhargavaz.net/w6mlp/blinkey
;Date: 7/14/04
;CPU: ATTiny11-6PC with internal oscillator
.device ATTiny11
.include "tn11def.inc"
.def Temp = R16
.org 0x0000
rjmp init
init:
ldi temp, 0x0FF ;All portB outputs
out DDRB, temp ;
ldi temp, 0x01 ;we will move 1 led
main:
rol temp ;Rotate temp
out portb, temp
rcall delay
rjmp main ;loop infinitely! Forever!
delay: ; provides some delay so that the LEDs are visible
; =============================
; delay loop generator
; 499998 cycles: about 1/2 seconds
; -----------------------------
; delaying 499995 cycles:
ldi R29, $0F
WGLOOP0: ldi R30, $37
WGLOOP1: ldi R31, $C9
WGLOOP2: dec R31
brne WGLOOP2
dec R30
brne WGLOOP1
dec R29
brne WGLOOP0
; -----------------------------
; delaying 3 cycles:
ldi R29, $01
WGLOOP3: dec R29
brne WGLOOP3
; =============================
ret
|