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

display calendar time

Good morning,
Can you give me some advice about displaying calendar time (seconds,minutes and hours after midnight )? What function returns current calendar time (for Cx51)?

Thank you very much.

  • Seconds after midnight isn't directly calendar time. No dates are involved.

    But to play with time, you first needs some form of clock. Do you have one? An external RTC? A processor with an internal RTC? Or a processor timer ticking at some multiple of 1Hz? Keil can't support anything, that they don't know the existence of.

  • I can organize RTC by the use of, for example, Timer 3, but I need time reading (I mean real calendar current time ) to start working. I don't have an internal RTC, so the only way to do this is using my PC. But I don't know if I can read real time connecting my microcontroller to PC by the use of USB debug adapter and how should I do it?

  • "I don't have an internal RTC, so the only way to do this is using my PC."

    Not true! There are plenty of other ways to get the time & date:

    There are plenty of RTC chips available.
    There are also modules that will receive radio time signals.
    A GPS receiver will give you date & time.
    An internet connection can give you date & time.
    You could have the user set it manually.
    etc, etc, etc...

    "I don't know if I can read real time connecting my microcontroller to PC"

    Yes, you can.
    It would obviously need something running on the PC to send the time...

    "by the use of USB debug adapter"

    That could be one way of doing it.

    "how should I do it?"

    You need to start by making a clear definition of what, exactly, you are trying to achieve here.