The AVR's timer...and those freaking datasheets
|
Submitted by poit on June 10, 2007 - 16:54.
| |
WOW, THAT was annoying. So in order to do a current and man future projects...I decided I should "learn" how to use the AVR timers. But the datasheets are kind of...long winded. I mean they're REALLY long. Consider this, the 16bit timer I was looking at has four 16bit registers. One's the timer it's self, that's a no-brainer. It counts. The other 16bit registers just hold values that are used to compare to that counter. That's pretty straight forward too. Next, there's a byte that holds the interrupt flags that make the processor do something special when say... the timer equals one of the counters...AND, a "mask" byte that's used to turn on/off the processor's attention to those flags. By the way, the interrupt/mask take up 2 pages in the datasheet. Now, that leaves two 8bit (well, maybe they're considered a single 16bit). The last two bytes worth of data tell the timer how to operate. Now as I mentioned, there are two pages in the datasheets that explain the interrupt registers...but the two timer control registers take 28 PAGES! It's so long winded that you actually get lost. Did a politician write this section or something? A lawyer? The guy from that old Animaniacs episode where Yacko, Wacko and Dot couldn't shake off the guy talking about Bob Barker eating a baloney and cheese sandwich? Oh well, that's behind me, once I recover from the ordeal of actually using the registers I can get back to getting the microcontroller to actually do something.
|
|