I have problems simulating the timer overflow in Atmel Studio 6. The code is for an Attiny10 and looks like below. As far as I know I set all the neccessary bits to enable the counter (which works in simulation) and the interrupt (which doesnt work in simulation).
I guess it's just a stupid mistake and I need a small hint so I would really appreciate if someone could tell me what I'm doing wrong.
;======================
; device attiny10
;======================
;.include tn10def.inc
; _____________
; /1 ° 6|
; O--|PB0 PB3|--O RESET
; | t10 |
; O--|GND VCC|--O
; | |
; O--|PB1 PB2|--O
; |______________|
;======================
; defines
;======================
.def temp = r16
;======================
; reset / int. vecs
;======================
.org 0x0000
rjmp reset ; Reset Handler
.org 0x0004
rjmp TIM0_OVF ; Timer0 Overflow Handler
.org 0x000A
;======================
; reset / setup
;======================
reset:
in temp, TCCR0B ; turn timer on
ori temp, (1<<CS00)
out TCCR0B, temp
in temp, TIMSK0 ; turn overflow interrupt on
ori temp, (1<<TOIE0)
out TIMSK0, temp
ldi 0xff
out DDRB, temp
ldi 0x00
out PORTB, temp
ldi temp, 0xff
out TCNT0H, temp
ldi temp, 250
out TCNT0L, temp
ldi temp, 0xff
sei
;======================
; main loop
;======================
main:
rjmp main ; while(1);
; overflow interrupt
;======================
TIM0_OVF:
com temp
out PORTB, temp
reti
EDIT: Solved: You cant step into/over an ISR. (Thx to Golaž)