lpc4088 RTC stucked

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

lpc4088 RTC stucked

跳至解决方案
2,581 次查看
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 项奖励
回复
1 解答
2,530 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the detail appearance of stuck?

 

 

 

在原帖中查看解决方案

0 项奖励
回复
7 回复数
2,559 次查看
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 项奖励
回复
2,572 次查看
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 项奖励
回复
2,559 次查看
alesandro_piazza
Contributor I

I cannot find any support for LPC4088 under SDK

0 项奖励
回复
2,546 次查看
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 项奖励
回复
2,541 次查看
alesandro_piazza
Contributor I

Hello!

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

 

0 项奖励
回复
2,531 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

What about the detail appearance of stuck?

 

 

 

0 项奖励
回复
2,513 次查看
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 项奖励
回复