Timer/Counter
Many people ask me about this, I think this is the time for me to start writing about timer or counter.
As long as I know, almost every microcontroller has a timer/counter feature. Not only AVR family but also the old micro such as MCS. The basic protocol not change at all, you just have to understand this one an then you will able to work with timer/counter in any other microcontroller.
I take an example ATmega 8535, take a look the datasheet its all there. There are Timer 0, timer 1, and sometimes timer 2. My senior at lab told me that timer 0 was not good enough, but i forgot to ask the reason. Maybe you wanna try to prove his suggestion (let me know if you already have the answer
)
Open page about the operation mode of timer. There are several mode of timer, in MCS usually there are only 3 mode, mode 0 mode 1 and mode 2, in AVR there are mode phase correct, phase&frequency correct, normal mode, etc… (i forget, can`t open datasheet right now). The important thing is, you should read and understan what the register are in timer/counter. there are TCNT, ICR, OCR. The fast way to understand How timer/counter works is by see the picture of timer/counter diagram in datasheet.
Guys….wait a moment please, gotta the job to do…. continue this post next week i have several project to finish…
-
Archives
- July 2010 (1)
- May 2010 (1)
- March 2010 (4)
- February 2010 (4)
- July 2009 (1)
- March 2009 (4)
- February 2009 (2)
-
Categories
-
RSS
Entries RSS
Comments RSS