X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=led_plex%2Ftimer.asm;h=9ef24acda63535213e7d4ef3e85c59e854dd069c;hb=32e3f51bc0f4248019379fe784d38c7fb770f952;hp=e6b8aec8ca8f7601f7aeaf98b38e1751c82b56d1;hpb=a20f57e053845b7a56c66999e6887aa0cb8c711f;p=my-code%2Fatmel.git diff --git a/led_plex/timer.asm b/led_plex/timer.asm index e6b8aec..9ef24ac 100644 --- a/led_plex/timer.asm +++ b/led_plex/timer.asm @@ -3,11 +3,23 @@ TIMER0_INIT: ; clock select - ldi tmp1,0x01 +.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 @@ -16,3 +28,12 @@ TIMER0_INT_INIT: ret +TIMER1_INT_INIT: + + ; overflow interrupt + in tmp1,TIMSK + ori tmp1,(1<<7) + out TIMSK,tmp1 + + ret +