I'm having some trouble cleaning the GIFR. So, I was wondering what was the proper way to write a logical one to the flag.
Using VMLab and coding for an ATtiny22, I tried loading the proper bit in to a register and then using OUT to the flag register.
ldi tmp,$40 out $3a,tmp
Flag stays set.
I tried using OR on the flag register and the temp register. and that gave me a compile err about improper operands, I tried both addressed for flag register, $3A and ($5A).
Thus I find myself at a loss to write a logical one to clear the flag.
Also I wondering why this bit is still set after the interrupt routine is done. I though it was suppose to self clear.
I have a rjmp in the interrupt routine, could that be causing the flag to remain set?
interrupt: sbrc flg,0 ; Was interrupt external? rjmp soft_int cbi $18,0 ; Yes, turn on LED 1 rjmp restart soft_int: cbi $18,2 ; No, turn on LED 2 restart: ldi tmp,$40 or $3a,tmp sbi $18,1 ; Reset pb1 high ldi flg,0 ; Reset interrupt flag sei ; Re-enable interrupts reti ; Onward...