Discussion in "Project Doubts" started by    chaitali20    Jan 4, 2014.
Sat Jan 04 2014, 01:35 pm
#1
I am making a digital calender using ds12c887 and at89c52. I can read the time from rtc properly. But i cannot write to rtc RAM.



code fragment i am using for writing is as follows:



void rtc_set()
{
delay_ms(20); // it provide 20ms delay
PBYTE[0x0a]=0x20; //make oscilator on
PBYTE[0x0b]=0x83; // disable updates
PBYTE[0x04]=0x16; //set hours
PBYTE[0x02]=0x58; //set mins
PBYTE[0x00]=0x55; // set secs
PBYTE[0x07]=0x19; //set date
PBYTE[0x08]=0x10; //set month
PBYTE[0x09]=0x04; //set year
PBYTE[0x0b]=0x03; //enable updates
}
Sun Jan 12 2014, 01:48 pm
#2
I do not see any issue in initialisation code. If you are able to read then you should be able to write too. After disabling updates can you do a simple write and read back, and confirm if write is a success.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

gtaletrzua
Fri May 03 2024, 10:55 am
Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am