I've used the timer in other modes but wanted to just get a basic timer interrupt going using the timer in normal mode and use the overflow interrupt to do it but can't see the interrupt happening.
I used the sbi trick for a pulse on PB1 to show that it is running but do not see a pulse on PB0 in the interrupt routine.
No wgm bits set since this is normal mode and all I do is start the timer or am I missing something?
.include "tn24def.inc" .def Temp =r16 .def Dely1 =r17 .def Dely2 =r18 .org 0x0000 rjmp RESET .org 0x000B ;Timer0 overflow vector rjmp TIM0_OVF RESET: ;ldi Temp,high(RAMEND) ;This causes an error on tiny24 ;out SPH,Temp ldi Temp,low(RAMEND) out SPL,Temp ldi temp,(1<<PB0|1<<PB1) ;Set PB0 & PB1 for output out ddrb,temp ;Timer0 in Normal mode(0) no need to set any WGM bits ldi Temp,(1<<CS02) ;Start timer0 with clk/256 out TCCR0B,Temp sei LOOP: rcall DELAY sbi PINB,PB1 ;toggle PB1 to show a system pulse rjmp LOOP DELAY: dec Dely1 brne DELAY dec Dely2 brne DELAY ret TIM0_OVF: ; Timer0 overflow sbi PINB,PB0 ;toggle PB0 to show overflow of timer reti