lpc4088 RTC stucked

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpc4088 RTC stucked

Jump to solution
1,388 Views
alesandro_piazza
Contributor I

Does anyone know the meaning of bit 0x00000020 fo CCR register? sometimes CCR goes to 0x31 (instead of 0x11) and RTC gets stucked... ther is no way to reset it (battery disconnection, power supply reset, uc reprogramming). Thanks!

0 Kudos
Reply
1 Solution
1,337 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the detail appearance of stuck?

 

 

 

View solution in original post

0 Kudos
Reply
7 Replies
1,366 Views
alesandro_piazza
Contributor I

Hi, I'm using this sequence:

Chip_RTC_Init(LPC_RTC);
//
FullTime.time[RTC_TIMETYPE_SECOND] = 0;
FullTime.time[RTC_TIMETYPE_MINUTE] = 0;
FullTime.time[RTC_TIMETYPE_HOUR] = 0;
FullTime.time[RTC_TIMETYPE_DAYOFMONTH] = 20;
FullTime.time[RTC_TIMETYPE_DAYOFWEEK] = 3;
FullTime.time[RTC_TIMETYPE_DAYOFYEAR] = 20;
FullTime.time[RTC_TIMETYPE_MONTH] = 01;
FullTime.time[RTC_TIMETYPE_YEAR] = 2021;
Chip_RTC_SetFullTime(LPC_RTC, &FullTime);

/* Enable rtc (starts increase the tick counter and second counter register) */
Chip_RTC_Enable(LPC_RTC, ENABLE);

 

void Chip_RTC_Init(LPC_RTC_T *pRTC)
{
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RTC);

/* Disable RTC */
Chip_RTC_Enable(pRTC, DISABLE);

/* Disable Calibration */
Chip_RTC_CalibCounterCmd(pRTC, DISABLE);

/* Reset RTC Clock */
Chip_RTC_ResetClockTickCounter(pRTC);

/* Clear counter increment and alarm interrupt */
pRTC->ILR = RTC_IRL_RTCCIF | RTC_IRL_RTCALF;
while (pRTC->ILR != 0) {}

/* Clear all register to be default */
pRTC->CIIR = 0x00;
pRTC->AMR = 0xFF;
pRTC->CALIBRATION = 0x00;
}

 

I have ten boards working properly, this same card worked fine before it was reprogrammed. Even if I uploaded old FW (using built in UART bootloader) there is no way to make RTC to count again.

0 Kudos
Reply
1,379 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

The bit 5 of CCR is no meaning, ignore it .

And pay attention all NC bits in this register CCR should be initialized when the RTC is first turned on.

Also there is RTC demo under LPCopen, recommend you have a look, download from:

https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcop...

 

 

 

Regards,

Alice

 

0 Kudos
Reply
1,366 Views
alesandro_piazza
Contributor I

I cannot find any support for LPC4088 under SDK

0 Kudos
Reply
1,353 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Sorry, under LPCopen, there is RTC demo for LPC4088:

https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcop... 

Alice_Yang_0-1611297037328.png

 

Regards,

Alice

 

0 Kudos
Reply
1,348 Views
alesandro_piazza
Contributor I

Hello!

I've just tried the demo code... same behaviour, rtc stucked.

 

0 Kudos
Reply
1,338 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the detail appearance of stuck?

 

 

 

0 Kudos
Reply
1,320 Views
alesandro_piazza
Contributor I

Hi, just solved thanks.

bad rtc crystal, I think something goes wrong when we fix them to the board (we fold the crystal).

 

 

0 Kudos
Reply