basic implementation done ...
[my-code/atmel.git] / led_plex / timer.asm
index e371f65..9ef24ac 100644 (file)
@@ -1,2 +1,39 @@
 ; timer functions
 
+TIMER0_INIT:
+
+       ; clock select
+.ifdef DEBUG_PORTS
+       ldi tmp1,0x03
+.else
+       ldi tmp1,0x02
+.endif
+       out TCCR0B,tmp1
+
+       ret
+
+TIMER1_INIT:
+
+       ; clock select
+       ldi tmp1,0x04
+       out TCCR1B,tmp1
+
+       ret
+
+TIMER0_INT_INIT:
+
+       ; overflow interrupt
+       ldi tmp1,0x02
+       out TIMSK,tmp1
+
+       ret
+
+TIMER1_INT_INIT:
+
+       ; overflow interrupt
+       in tmp1,TIMSK
+       ori tmp1,(1<<7)
+       out TIMSK,tmp1
+
+       ret
+