tq for ur rply.can u explain with a example plz
Hi,
For Example : Let assume we have 1) AT89C51 2) DS89C420 , both with a 24MHz Clock
In AT89C51 , The Clock source for timers is same as machine cycle ,so it is 24MHz/12=2MHz
In DS89C420 ,when you program it and don't change anything in special SFRs, is same as AT89C51 (24MHz/12=2MHz, for compatibility) , but DS89C4xx series have some special SFR bits for timers :
1) TxM in CKCON Register and TxMH in CKMOD Register (for Ex : T0M & T0MH for timer 0 , .. etc). if you set TxM & Clear TxMH bit for a timer , the clock source for that timer will be System Clock/4. For Ex: if you set T0M=1 & T0MH=0 , the clock source for TIMER0 will be 24MHz/4=6MHz.
if you set TxMH bit for any timer (regardless of TxM state) the clock source will be same as system clock , for Example if you set T0MH=1 (T0M state doesn't Matter) , the clock source for Timer0 ,will be same as system clock=24MHz.
This is true for all 3 timers of DS89C4xx , but Timer2 is a different beast (with some interesting features). I strongly recommend that you read this Document Carefully :
Good Luck!