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

How can i convert BCD data to real value?

I am doing a project which will get a time data from external Real time clock chip.
The data format of the RTC is in BCD form.

How can i convert BCD data to real value?
is there can built-in function to do that?
pls help

Parents

  • What's the "real" value for real time clock data? A data/time string? 32-bit unsigned integer number of seconds since January 1, 1970? A structure of integers for year, month, day, hours, minutes, seconds?

    I don't know of any standard C functions that deal with BCD representation. Conversion to a "normal" two's-complement integer is pretty straightforward.

Reply

  • What's the "real" value for real time clock data? A data/time string? 32-bit unsigned integer number of seconds since January 1, 1970? A structure of integers for year, month, day, hours, minutes, seconds?

    I don't know of any standard C functions that deal with BCD representation. Conversion to a "normal" two's-complement integer is pretty straightforward.

Children
No data