Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] still no working interrupt )-:

2007-01-08 by Richard Reeves

I think you're setting the wrong bits in TIMSK.  If you want to 
enable Compare A and the Overflow for Timer0, you need to load TIMSK 
with $12 according to the simulation I have running now, which works 
id I manually set those bits in TIMSK.




Richard
> 
> I don't get it.  My stand alone interrupt routine works, but I cannot
> seem to get interrupts to work in this program.  here is the code
> (with comments which reveal proprietary information redacted out):
> 
>     ldi    TEMP,    0x02                    ; set WGM1:0 to 0x02
>     out    TCCR0A,    TEMP                    ; and store in TCCR0A
>     ldi    TEMP,    0x04                    ; set wgm2 and CS2:0 out
>     TCCR0B,    TEMP                    ; store in TCCR0B
> 
>     ldi    TEMP,    0x40;                    ; enable timer/counter 0
> compare match A interrupt
>     out    TIMSK,    TEMP                    ; store to timer/counter
>     0 
> Interrupt mask register


---
"Sve je bilo tako tiho a nemirno..."
   http://www.musicvangogh.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.