Go Down

Topic: Looking for documentation to understand interrupt flags (Read 806 times) previous topic - next topic


I'm looking at interrupt setup code written by someone else. I understand the logic operators to get the flag bits set or cleared, but I'm having problems locating documentation that explains the meaning of the bit flags. Is there a recommended "go to" document/url to get a good understanding about interrupt flags and how they are used?

For example ...

Code: [Select]

    TCCR2A = ((1 << WGM21) | (0 << WGM20));
    TCCR2B = (( 1 << CS22 ) | ( 1 << CS21 ) | ( 1 << CS20 ));        // 1/2^10
    ASSR &= ~(1<<AS2);
    TIMSK2 = (1 << OCIE2A);                 // Enable TIMER2 compare Interrupt
    TCNT2 = 0;
    OCR2A = TICK_DIVIDER;     // must be loaded last for Atmega168 and friends

... where do I go to understand what WGM21 or ASSR mean and how they are used?

Thanks ddm


The go-to document for how a processor works is the datasheet.  For the Arduino UNO the processor is the ATmega328P so the datasheet is:


You can search the PDF for the register names.  You'll find a section that describes that register and the fields within it.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


where do I go to understand what WGM21 or ASSR mean and how they are used?

Try the device datasheet.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131