
AVRASM ver. 1.57  led_cycle.asm Thu Aug 03 12:37:09 2006


         ;Tiny 11 - Test of ADC - also include multiplex display driver.
         
         ; Specify Device.
          .device ATTINY11
         
         ; I/O Register Definitions
          .equ    SREG    =$3F
          .equ    GIMSK   =$3B
          .equ    GIFR    =$3A
          .equ    TIMSK   =$39              
          .equ    TIFR    =$38 
          .equ    MCUCR   =$35
          .equ    TCCR0   =$33
          .equ    TCNT0   =$32
          .equ    TCCR1   =$30
          .equ    TCNT1   =$2F
          .equ    OCR1A   =$2E
          .equ    OCR1B   =$2D
          .equ    PORTB   =$18
          .equ	DDRB    =$17
          .equ    ACSR    =$08     
          .equ    ADMUX   =$07
          .equ    ADCSR   =$06
          .equ    ADCH    =$05
          .equ    ADCL    =$04       
         
          .cseg					; CODE segment.
         
         ;Interrupt Vectors
          .org 0
000000 c000      	rjmp init			;Reset
         
         ;Initialization      
          init:   
         
000001 e008      	ldi r16,$8		; 1 bit are outputs
000002 bb07      	out DDRB,r16   	; set portb bit 3 for outputs to display
         ;	ldi r16,5		; Timer 0 rolls over at 1MHz/1024/256 = 97Hz/3
         ;	out TCCR0,r16
         
         ;	sei			; Enable Interrupts    
         
000003 e008      	ldi r16,$8		; LED OFF
000004 bb08      	out PORTB,r16
         
         
          loop1: 
000005 d003      	rcall Delay
000006 9502      	swap r16
000007 bb08      	out PORTB,r16
000008 cffc      	rjmp loop1                            
                                        
          Delay:
000009 ec18      ldi r17,200
00000a e028      d1: ldi r18,8
00000b e43d      	d2: ldi r19,77
00000c 0000      		d3: nop
00000d 953a      			dec r19
00000e f7e9      		brne d3
00000f 0000      		nop
000010 952a      	dec r18
000011 f7c9      	brne d2
000012 0000      	nop
000013 951a      	dec r17
000014 f7a9      brne d1
000015 9508      ret
         
         

Assembly complete with no errors.
