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.

Using RTC in TM4C1294NCPDT

Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C1294XL

Hi

I am working on tm4c1294ncpdt using CCS IDE for my application. Here I am continuously writing the sensor data to a text file which is stored in the pendrive. So, my objective is to write the timestamp along with the sensor data.

So, I thought of using RTC (Real time clock) in my application such that whenever a data is written into the file, its timestamp will also be written together.

But in the time being, I don't have much idea about RTC. I have gone through the RTC and Hibernation module in datasheet.

Do we need any extra components (crystal, oscillator or external battery) for this purpose?

Can anyone please share some sample code such that it may help me 

Thanks and Regards

Subash

  • Hello Subash,

    For a general time/date/year example have a look at the hibernate example for the tm4c129 launchpad located here: C:\ti\TivaWare_C_Series-2.1.1.71\examples\boards\ek-tm4c1294xl\hibernate (note the exact path on your machine may vary dependent on the version of TivaWare and the location you installed it to).

    In regard to the RTC clock source, the Hibernate RTC oscillator (RTCOSC) clock that can be configured to be the 32.768-kHz external oscillator source from the Hibernation (HIB) module or the HIB Low Frequency clock source (HIB LFIOSC), which is located within the Hibernation Module.
  • Hi Chuck,

    Thank you for your response. I followed your procedure and successfully executed the hibernate example. After executing I can see the current date and time in the console. In the program I have set the default time and date as current date and time.

    The problem I am facing is whenever I do reset, the time is again starting from the default time that is programmed in the controller. The board is continuously powered up using micro USB. So my query is when board is continuously powered up even if I press reset, the current time should get displayed rather than default time .

    I don't know whether I misunderstood something or not. Please clarify me. It will be helpful to me.

    Thanks and regards,

    Subash

  • Hello Subash,

    The time should be maintained through a system reset when power is not removed as long as the hibernate module is continued to be powered by vbat. Can you confirm if the microcontroller actually enters the hibernate mode and if so, is it able to wake with consistent calendar data?
  • Hi Chuck

    Ya.. its working and it is entering into hibernate mode and is able to woke up with consistent calendar data. The time is maintained on reset.

    I couldnt understand how to power up the hibernation module alone using Vbat. Because, Vbat pin is not taken out in the breakout board (ek-tm4c1294xl)

    So, how can I power up the hibernation module using Vbat?

    Thanks and regards

    Subash

  • Subash,

    There are several threads on connecting Vbat on the launchpad. Here are some links to two of them:

    e2e.ti.com/.../429911
    e2e.ti.com/.../505253

    You can also have a look at the schematic to determine exactly where to place it. The launchpad user guide has a schematic in it and is available here: www.ti.com/.../spmu365