How to genrate interrupts every 0.1s or 0.01s using DS12887?

Status
Not open for further replies.

DrWhoF

Advanced Member level 1
Joined
May 6, 2005
Messages
402
Helped
24
Reputation
48
Reaction score
11
Trophy points
1,298
Activity points
4,388
I send data from 87C52+DS12887 (6818 RTC) via serial port to a PC.
Data string contains date and time as follows.
DD-MM-YYYY,HH:MM:SS.
I want to send data every 0.1s or 0.01seconds.How to genrate interrupts every 0.1s or 0.01s using DS12887?
DD-MM-YYYY, HH:MM:SS.XX
 

Re: 6818 RTC and 0.01s

The DS12887 can not directly generate 0.01 or 0.1s interrupt ..
The closest you can get is ≈977µs (Periodic Interrupt Rate RS0=0, RS1=1, RS2=1 and RS3=0) ..
If you count this interrupt for 10 times you will end up with 0.00977s, or if the count is 103 the result is 0.1006s .. is it good enough?

Regards,
IanP
 

    DrWhoF

    Points: 2
    Helpful Answer Positive Rating
Re: 6818 RTC and 0.01s

I have problems with synchronization of 0.1s generated by 0.1006s interrupts and 1s clock. How to synchronize them?
 

Re: 6818 RTC and 0.01s

I guess you have a counter that counts 977µs interrupts, so the obvious thing to do is to zero this counter on 1s interrupt ..

Regards,
IanP
 

    DrWhoF

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…