Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/07/00 20:13
Read: times


 
#5539 - RE: What's Wrong with my RTC ??
Hi babar,

I used a 11.059200MHz crystal.
with the following settings/equates.

Timer1 used in 16bit mode,
Timer one loaded with 4BFC, at every T1 interrupt, tick is reduced by one and if reached to zero, increases seconds by one.... minutes.... 10s minutes..... hours.... 10s hours.

Tick = 1/20 of a second
Sec = Seconds
Min = minutes
Minx= 10s minutes
Hr = hours
Hrx = 10s hours.

I kept hours and 10s hours seperate so I can get direct BCD values, reducing calculation everytime to show on display.

It is working fine, and accurate, as far as for 3 days i checked, carefully.

You must consider the time for codes,if any during timer reload.

As soon as T1 int. occure the first thing I do in my code is to stop the timer, reload it with default value (4BFC) and start T1 again. after doing this I examine the Tick, sec etc. I calculate that time period required for:

CLR TR1
MOV TH1,#4Bh
MOV TL1,#0FCh
SETB TR1

and add this into my calculation for reload value of T1.

You can try it out, I am sure it would work.

I understand you used 12.00MHz Xtal because you were looking for accuracy. But I feel, due to cheap market stretegy, you do not get 12.00MHz xtal, it is just printed on it 12.00MHz but it actually is 11.059200MHz.
Try with the same xtal, considering it 11.0592MHz and see. I hope it will work.

If you want I can send you my code for this.

Rauf

List of 10 messages in thread
TopicAuthorDate
What's Wrong with my RTC ??            01/01/70 00:00      
RE: What's Wrong with my RTC ??            01/01/70 00:00      
RE: What's Wrong with my RTC ??            01/01/70 00:00      
RE: What's Wrong with my RTC ??            01/01/70 00:00      
RE: Nothing anymore Wrong with my RTC ??            01/01/70 00:00      
RE: What's Wrong with my RTC ??            01/01/70 00:00      
RE: Nothing anymore Wrong with my RTC ??            01/01/70 00:00      
RE: Nothing anymore Wrong with my RTC ??            01/01/70 00:00      
RE: Nothing anymore Wrong with my RTC ??            01/01/70 00:00      
RE: What's Wrong with my RTC ??            01/01/70 00:00      

Back to Subject List