??? 01/27/09 20:45 Read: times |
#161759 - ADUC845 Timer2 Control Basics |
On the 845 chip there are two 8 bit registers TL2 & TH2 which act as an increment counter. I came across this Analog Devices sample code and I'm trying to understand why these registers were initialized the way they are. Does anyone have any idea?
...insert code here #include <stdio.h> #include <ADuC845.h> sbit LED = 0x0B4; void interrupt_0 () interrupt 5 { LED ^= 1; TF2 = 0; } void main (void) { ET2 = 1; //Enable Timer 2 Interrupt TL2 = 0x0; //? TH2 = 0x67; //? RCAP2L = 0x0; //Timer2 Capture/reload Low Byte RCAP2H = 0x67; //Timer2 Capture/reload High Byte EA = 1; //Enable Interrupts T2CON = 0x04; //Timer2 Start while(1); } |
Topic | Author | Date |
ADUC845 Timer2 Control Basics | 01/01/70 00:00 | |
Well well... | 01/01/70 00:00 | |
I'm guessing you already know.. | 01/01/70 00:00 | |
Doesn't clarify why that value | 01/01/70 00:00 | |
the absolute duration of one timer tick... | 01/01/70 00:00 | |
not important, but what is | 01/01/70 00:00 | |
The timer tutorial was not helpful | 01/01/70 00:00 | |
It's the math that doesn't seem to work | 01/01/70 00:00 | |
321 Interrupts | 01/01/70 00:00 | |
Experimental path probably best | 01/01/70 00:00 | |
BTW - XLS Modeling | 01/01/70 00:00 | |
Timer counters connected to PLL![]() | 01/01/70 00:00 |