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