- This topic has 3 replies, 2 voices, and was last updated 10 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › how to set time and date in rtc ds12c887
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
}
Plz help me to find the problem in my code.
Hi,
Which microcontroller?
This is not the function which actually do write something to thr RTC !
microcontroller is atmel 89c52.
hey , then plz tell me the function which will write to RTC.
Plz.. Plz…..
Hi Chaitali,
Sorry for the late response. The entire code is with you only, so there must be a function in your code which sends data and receives data from the serial pins of the microcontroller and hence does the writing to the RTC.