schmidtbag:
So, if I put a piezo buzzer on that, it would create a tone of 5000Hz?
Er, no. About 1.56 Hz because of the prescaler (and because it takes two toggles per period).
schmidtbag:
Are you saying that I would have to change values like TCCR1A and OCR1A to change the frequency from like 500Hz to 10KHz?
You change OCR1A which is the amount it counts up to.
How am I supposed to know what to change them to?
Ah, with a calculator? The maths is well-defined and described in the datasheet. The raw input to the timer is the processor clock, which clocks every 62.5 nS for a 16 MHz clock. A prescaler of 1024 (if you choose to use that) will give you a count every 64 uS. Then if you count up to 5000 before toggling you are now up to 320 mS. Since it takes two toggles to give a period (one on, one off) your period is 640 mS. The frequency is the inverse of that: 1.5625 Hz.
What causes the need to change?
Only if you want different frequencies. Like, play a tune. If you don't want different frequencies you don't need to change it.
What causes the LED to pulse when there is nothing that sets it to a LOW value?
It toggles. On/off.
And what do _BV and WGM12 and all that stuff mean?
_BV is a macro: 1 << x. So _BV (4) is 1 << 4, effectively bit 4 (if you count from zero).
WGM12 and all that stuff: as described in the datasheet.
I think you did a good job writing your reference ...
Thank you.
... but it doesn't explain everything. It states a feature, gives an example scenario, and shows a code on how that scenario could be performed (which is great, that's how it should be done) but it doesn't explain why everything is the way it is and why certain values are used, and it isn't clear what's a constant and whats a variable. For many people on these forums, they don't care - they just want to copy a code and make sure it works. But I don't like taking something unless I actually understand it. Your guide is overall informative and an easy read, but I'm going to need some extra assitance.
The page was really about interrupts, not timers. I have another page about timers:
Ultimately you need to read the datasheet.
http://atmel.com/dyn/resources/prod_documents/8271S.pdf
(That's for the 328). I don't have the link to hand for the 1280 but it will be on the Atmel web site.
There are also quite a few good other resources about Atmega328 timers, and how to use them. Calculators to work out exactly what values to choose, I dare say.