Hello,Does anyone know how to use the RTC of Cc2642? Is there a routine?
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.
Hello,Does anyone know how to use the RTC of Cc2642? Is there a routine?
Hello,
How are you? If you are looking for information regarding the use of RTC, I would recommend first looking at our resources available in our SDK, specifically in the DriverLib aon_rct.h reference. For some slightly deeper information look at the aon_rtc register descriptions found here. If you need more information or help, could you provide your SDK, and CCS version, as well as how you want to use RTC. Also, there are other E2E threads available that mention the use of RTC. You can also view the RTC in register view in CCS when in debug mode to see what it is doing.
Thanks,
Alex F
Hi, Alex, Thank you for your prompt reply. I have used AON RTX now under your help, and here I still have one question, why I can not write the reg: SEC, like this:
void RTC_UTC_setClock(uint32_t newTime)
{
#ifndef USING_AON_RTC
RTC_UTC_timeSeconds = newTime;
#else
HWREG(AON_RTC_BASE + AON_RTC_O_SEC) = newTime;
#endif
}Hello,
Good to hear that you are now using AON RTX. I had another E2E post that had a similar issue found here; it may not be easy to manipulate the register itself if that is what you are trying to do.
Are you trying to do something similar to AONRTCSecGet()?
where the function returns:
{
// The following read gets the seconds, but also latches the fractional
// part.
return(HWREG(AON_RTC_BASE + AON_RTC_O_SEC + NONSECURE_OFFSET));
}
You could store this value locally and find the difference between new and old timings.
Thanks,
Alex F
Hello,
There are a few ways to manipulate the RTC, one I would recommend is use the functions defined by the driver library found here. The driver library resource provides many functions that can be helpful when manipulating the RTC.
There are also a few other threads on E2E which discuss the use of RTC:
RTC TIME RESET ON WATCHDOG RESET - Bluetooth forum - Bluetooth®︎ - TI E2E support forums
CC2642R-Q1: cc2642 RTC peripheral - Bluetooth forum - Bluetooth®︎ - TI E2E support forums
Thanks,
Alex F