LPC 4088 RTC

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

LPC 4088 RTC

4,591 次查看
chaitanyakulkar
Contributor II

I am Using LPC 4088. In which i have using inbuild RTC.The Code Working Properly but after a Removing of VBat. for testing i have Applied VBat Again but that Time RTC  Not  Working.on Same Code. Even I have reinnetialised RTC After this.So please send me Regarding Changes so that  we Can Fixed this Problem.

标签 (3)
0 项奖励
回复
8 回复数

4,165 次查看
chaitanyakulkar
Contributor II

Hello Victor,

This Issue is Purely based on Software.As RTC Module has Not Getting Supply From VBat and System Supply,RTC SFRs resets Their Value and SFRs get Froze. After Supply Provided to it. RTC will Not Functions Even After Reprogram its.So Problem is to resets all SFR and Re-initialization of RTC.I have Not Getting Code regarding this So Please Reply ASAP Regarding Changes in Code. 

Thanking You

0 项奖励
回复

4,165 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello chaitanya Kulkarni

If everything is ok in the hardware then the problem is that you are not initializing the RTC again when you disconnect the system supply and Vbat. I took the the example periph_rtc of the LPCOpen mentioned before (LPCOpen Software for LPC40XX|NXP).

I modified the example to initialize the RTC and set the default hour and date when necessary. To know when I have to initialize the RTC I checked the bit '1' in the CCR register (Clock Control Register) using software. Please see image below, to understand why the bit 1 in the register CCR. 

pastedImage_2.jpg

In the example, I added an if condition to check if the RTC  need to be initialized then I call the function RTC_INIT and I set the default date and hour. If the RTC is enabled then I do nothing and continue with the program normally to avoid loosing the count of the RTC. 

if( (LPC_RTC->CCR & 1) != 1)
{
     Chip_RTC_Init(LPC_RTC);
     /* Set current time for RTC 2:00:00PM, 2012-10-05 */
     Chip_RTC_SetFullTime(LPC_RTC, &FullTime);
}

‍‍‍‍‍‍‍

In the next image you can see the results of running the program. 

pastedImage_3.jpg

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 项奖励
回复

4,165 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello chaitanya Kulkarni

I don't know if I understood you correct. When you connect VBAT again the RTC doesn't work at all anymore until you make a reset? Are you using any development board or a custom board? 

Regards, 

Victor.  

0 项奖励
回复

4,165 次查看
chaitanyakulkar
Contributor II

Hello Victor,

We are using Custom board and Software Sample code is "LPC Embedded Artist Code".Code is not working After Reset or even after a Reprogram of system still RTC is Not Working.

0 项奖励
回复

4,166 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello chaitanya Kulkarni

Thanks for  the reply and for clarifying the information. Are you using the code that is available in the following page: LPCOpen Software for LPC40XX|NXP ? 

Since you are using a custom board I will need to take a look into the schematics to rule out hardware problems. A good idea will be to take a look into the schematics of the LPC4088 Experiment Base Board|NXP  to use this as a reference to see if  everything looks good in your schematics.

Regards,

Victor. 

0 项奖励
回复

4,166 次查看
chaitanyakulkar
Contributor II
Hello Victor,
We are already Verified our Schematic with reference to LPC4088 Experiment Board (Embedded Artist).We Observed that if system is on and if you remove battery still Time Count Incremented. Before Switched off if we attached battery then still after a resetting system RTC Returns Correct Value. But In This case if System is switched off and you remove the Battery for some time and you still installed a battery before you switched On the System.You switched On System After this Then RTC Value Get Resets  (That's OK) but Value is Not getting Incremented(That's the Main Problem )
0 项奖励
回复

4,034 次查看
alesandro_piazza
Contributor I

hi chaitanyakulkar!

have you solved?

I have the same problem... RTC get stucked and there is no way to reset it again...

 

0 项奖励
回复

1,762 次查看
azzurrodante
Contributor I

I have the same probem  :  

with battery inserted  sometimes i 'have RTC  stuck  , 

but  the  register CCR CLOCKENABLE == 1  is ok    and data is ok  

 

There is mode to starting RTC withouth remove battery    ?  i've also insert a code 

https://community.nxp.com/t5/LPC-Microcontrollers/LPC-4088-RTC/td-p/807756

that starting Intit rtc only if  CCR bit 0  == 0  .

 

Now for re-starting RTC i need remove battery ,  power off  and power on and Init_Rtc 

 

 

 

0 项奖励
回复