This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Increment Data address of 24c16

hi all...
i am making a small project where i need to interface the RTC with 8051.
i have done with it. and now i am want to save the time and date in EEprom AT24c16.
i have already done interfacing of RTC and saving the data in eeprom...
code is

void save()             //save in EEPROM
{
    start();
        send_byte(0xA0);    //device address
        aknowledge();
        send_byte(0x00);   //word address, Page Numbers
        aknowledge();
        send_byte(hour);
        aknowledge();
        send_byte(min);
        aknowledge();
        send_byte(sec);
        aknowledge();
        send_byte(day);
        aknowledge();
        send_byte(month);
        aknowledge();
        send_byte(year);
        aknowledge();
        stop();
        msdelay(10);
}


but what happens here is everytime it saves the date and time at the same address... i mean it overwrites the new data. but i want something like the word address should get changed everytime before it saves the datas, to avoid the overwrite's..
how can i do it...