AVR Studio Bug? ATTiny15L, Timer1 Compare Match Interrupt

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

i've written some code that should send a datastream syncrounus. For this i set up the Timer1 to CTC Mode an wrote my Timing Value to OCR1A and enabled the Overflow Interrupt.

When simulating the code with AVR Studio 4, 9, 0, 338 the Interrupt Flag for Timer1Compare Match (OCF1A) did not get cleared. Datasheet says: "OCF1A is cleared by hardware when executing the corresponding interrupt handling vector"

Here the relevant code:

.org T1CPaddr		; Timer1 Compare Interrupt
	rjmp	UpdateData

...

UpdateData:
	clc
	ror	keyH
	ror	keyL
	brcs 	sendOne
sendZero:
	cbi	PORTB, Dout
	rjmp	sendDone
sendOne:
	sbi	PORTB, Dout
sendDone:
	dec	cnt

	cpi	cnt,0
	brne	sendRet

	clr	tmp
	out	TCCR1, tmp
	out	TCNT1, tmp
	clr	done

sendRet:
	reti


Is there a failure in my code, or is it a AVR Studio Bug?

Hava a look at my web page -> http://www.tobiscorner.at.tf