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

real time clock calculation

Hai,
i am using lpc2368 microcontroller in my embeddd project.
i am displaying the clock in lcd also using RTC calculation.
i am stuck with a section in which we have to find the clock duration between
end time and running time.

the end time is obtained by transmitting it serially.
the running time is the current rtc time and i am getting it

so please help me in this section
i am attaching the running time section program

unsigned char hh[2],mm[2],ss[2];
hh[0]=(RTC_HOUR)/10+0x30;
hh[1]=(RTC_HOUR)%10+0x30;
mm[0]=(RTC_MIN)/10+0x30;
mm[1]=(RTC_MIN)%10+0x30;
ss[0]=(RTC_SEC)/10+0x30;
ss[1]=(RTC_SEC)%10+0x30;


the following code of substraction of running time from end time will work numerically

        hh[0]=(bus_time_msg[0]-hh[0])+0x30;
        hh[1]=(bus_time_msg[1]-hh[1])+0x30;
        mm[0]=(bus_time_msg[3]-mm[0])+0x30;
        mm[1]=(bus_time_msg[4]-mm[1])+0x30;
        ss[0]=(bus_time_msg[6]-ss[0])+0x30;
        ss[1]=(bus_time_msg[7]-ss[1])+0x30;


where the bus_time_msg[] is obtained serially

so please help me in this section

0