Pages: [1]   Go Down
Author Topic: Looking for documentation to understand interrupt flags  (Read 409 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
    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
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8716
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

http://www.atmel.com/Images/doc8161.pdf

You can search the PDF for the register names.  You'll find a section that describes that register and the fields within it.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Try the device datasheet.
Logged

Pages: [1]   Go Up
Jump to: