跳至主要內容
Knowledgebase
Home
Renesas Electronics Taiwan - Knowledgebase

When I use PDG2, RTC is not initialized at power-on

Last Updated:06/14/2017

Question:

Although the R_PG_RTC_Start() function is called in PDG2, sometimes RTC is not initialized.

Answer:

RTCx absolutely needs the reset processing because register values are undefined immediately after power-on. Even when the R_PG_RTC_Start(void) function that was generated by PDG2 is run, RTC might not operate. In such a case, you can let RTC operate by adding the following codes in red. Modify as necessary.

Before modification:

R_PG_RTC_Start();

After modification:

/* Disable RTC interrupts */
RTC.RCR1.BYTE = 0x00u;
while (0x00u != RTC.RCR1.BYTE)
{  /* Confirm that it has changed */  nop(); }
R_PG_RTC_Start();

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
Code Generator
PDG