Wierd problem with DS12887 RTC

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 can read and modify seconds and years but I can not access and modify minutes, hours, days and months.
Seconds count from 0-59 and then there is no change in miutes, hours and so on.
The system is working in standard configuration with 8051 microcontroller/RS232-PC.
What can be the reason?
Thanks.
DrWho
 

You have take into account this:
The DS12887 like its predessesor, the 6818, periodically updates all time and date registers ..
If you attempt to read them during the update procedure, they may be not accessible, hence, you will read "nothing" ..
Try to sense the UPI (update-in-progrss) bit and read/write the RTC when it is permissible ..
Regards,
IanP
 

    DrWhoF

    Points: 2
    Helpful Answer Positive Rating
You must set regB = 0x86, For example :


oldregB = regB;
regB = 0x86; //must require
second =ggetnum();
minute =getnum();
hour =getnum();
for(c=255;c>0;c--);
regB=oldregB;

I have made RTC DS12887 with AT89S52. It works well.

Noi - nvnoi@vtihcm.com.vn
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…