This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: real time clock connfiguration problem

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL, TM4C1294NCPDT, EK-TM4C1294XL

Tool/software: Code Composer Studio

hello,

i am using TM4C123GH6PM and i am planning to use  RTC of hibernation module as a real time cloke can you provide me any reference code for this purpose. 

  • Hello Sunil,

    We have an example like that for the DK-TM4C123G located at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c123g\hibernate

    This would show all the configurations needed.

    You could also port this to your EK-TM4C123GXL by removing the code for the LCD. You may possibly need to adjust a couple GPIO's as well, but overall it should be easy to port over.

  • hello Ralph Jacobi,

    I just went through the example you have suggested,the code is all about how a system goes into hibernate mode and gets interrupted when  the rtc timer count value matches with the value set by HibernateRTCMatchSet(0, 5).

    but my case is little different i want to set or initialize RTC at 1st with current date and time and use the RTC's count feature so that later (maybe after several boots and /or after several days)  i can get exact time and date without any delay or lag so that I can send my sensor data along with accurate time whenever  i needed.

    i have used a coin cell battery (supplying the rtc when power to the system is off).

    please provide some valid solution.

  • Hello Sunil,

    If you are wanting to configure the RTC based on date and time, you need Calendar mode functionality for that. TM4C123x MCU's do not have Calendar mode functionality. You would need to use an MCU such as the TM4C1294NCPDT which is part of the TM4C129x series that offers Calendar mode as part of the hibernation/RTC functionality. The EK-TM4C1294XL LaunchPad is the recommended evaluation kit for that series of MCU's, and we have an example that uses Calendar mode at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\hibernate
  • Hello Ralph Jacobi,

    Thanks for your information i cant change the mcu but i have made my own wrapper function to provide this functionality.

    There is one problem though i have used your hibernate rtc api for the second count but after 1 day of rtc initialization time is 1 day and 15 minutes.

    In my function i am just converting rtc count value in day format and i have used external 32.768khz crystal and used your hibernate api to use predivider to make 1hz and count seconds.

    Can you tell me the solution for this problem.

  • Hello Sunil,

    Depending on how you are doing the counting, you may be introducing a small delay that is resulting in the mismatch of your elapsed count. Wouldn't it make sense to just check the RTC count until you hit 86400 and then indicate a day as passed at that point?