Enable interrupt on INT0
This commit is contained in:
+6
-1
@@ -9,7 +9,7 @@
|
||||
.org 0x0000 ; RESET Vector
|
||||
rjmp main
|
||||
.org 0x0002 ; INT0 button interrupt (tap tempo)
|
||||
;rjump tap_tempo --> should have timer0_start --> if timer0_overflow_count=0 start timer (?)
|
||||
rjmp tap_tempo_isr
|
||||
.org 0x0004 ; TIMER0 overflow
|
||||
rjmp timer0_isr
|
||||
.org 0x0006 ; TIMER1_COMPA
|
||||
@@ -44,6 +44,11 @@ main:
|
||||
cbi DDRB, PB2 ; Set EC11 button (555 square wave) on PB2 as input
|
||||
sbi PORTB, PB2 ; Enable pull-up on PB2
|
||||
|
||||
ldi r16, (1<<ISC01) | (0<<ISC00)
|
||||
out MCUCR, r16 ; ISC01=1, ISC00=0 → falling edge
|
||||
ldi r16, (1<<INT0)
|
||||
out GIMSK, r16 ; Enable external interrupt INT0
|
||||
|
||||
;ldi r26, 60 ; Default BPM //TODO: save to eeprom not register, on runtime also ldi on r24 register
|
||||
|
||||
; Setup general registers and global variables
|
||||
|
||||
Reference in New Issue
Block a user