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.

To set hibernate rtc for tiva microcontroller

Other Parts Discussed in Thread: TM4C1233H6PM

Hello,

          I want to set hibernate rtc of tiva microcontroller ( TM4C1233H6PM ). Every where in the forum the hibernate rtc is set to zero but i don't want that, i want to set rtc on my own. There is the function as " void ulocaltime(time_t timer, struct tm *tm) " which coverts the string of seconds coming from rtc to sec, min, hour, week day, month, year to there values. 

Like that i want the function or program which will covert the above time values to string of seconds which i can put into the function of " HibernateRTCSet (string of seconds) ; " to set rtc to desired time.

Please give the codes for it  asap.

Thanking you.

Regards,

Virendra Raut

  • Hi,

    You can find out: time_t umktime(struct tm *timeptr) same place like ulocaltime.

    Petrei

  • Hi,

         Thank you for your response but that function you said checks previous time compare it and according to difference between both of them, the result that has been got  is put in the hibernate rtc set function.

    So that is not the proper function that you show to me.  Please give the other function and solution to me.

    Thanking you.

    Regards,

    Virendra Raut

  • Hi,

    Now I really do not understand your request - what do you need? not a function to transform your time structure to seconds to be put to rtc? why do you complain about the procedure inside this function (although it is a good thing to read code body) - did you used/checked this function and gave you bad results? 

    The alternative is to google for mktime function - (this one is TI's particular implementation).

    Petrei

  • Suggestion ..

    I'm a newbie with ???Ware

    But I think OP wants to convert a "sec, min, hour, week day, month, year" into seconds (systime),

    hopefully via a struct tm *timeptr .

    Then he can put the "future" seconds into the function HibernateRTCSet (string of seconds) ;

    The suggested time_t umktime(struct tm *timeptr) , might be a good start , but i haven't read the docs yet

    /Bingo