LPCXpresso546xx battery connection

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

LPCXpresso546xx battery connection

693 Views
primate
Contributor III

Hello,

I am having a project with an LPCXpresso54628 rev C board utilizing RTC. Therefore I wanted to use a battery on the board to keep the RTC running when the power is switched off. However, when the coin cell 3.6V battery is connected on the J10 connector pin 11 and 16 (pic below, + on pin 11) it seems like it is not running the RTC and when I power on the board the date/time I have set up previously runs from the beginning. 

pastedImage_1.png

Is there an additional setting I have to make or is the wiring I have made wrong? It seems straightforward but maybe I am overlooking something.

Thank you for any help.

Labels (1)
2 Replies

497 Views
miguel_mendoza
NXP Employee
NXP Employee

Hi primate,

The way that you connect the battery on the board to keep the RTC running is correct.

The problem founded (using the RTC SDK example) when you power on the board, a function (RTC_SetDatatime) runs and that's why the Data/time runs from the beginning, so you can check in your code, if something like this is happening, and put some conditional that ask the users if want to start from the beginning or keep the last, almost program a new Data/Time. 

If you are still stuck, please provide some more details about your code.

497 Views
primate
Contributor III

Hi Miguel,

Actually I found out that the RTC_SetDatatime was not the problem but that I have forgot to remove the part of the code that initializes the RTC every time the board is fully powered up. But when you mentioned initialization it came to me. To be exact (and for future reference) I have removed:

// Set a start date time and start RT
date.year = 2012U;
date.month = 05U;
date.day = 19U;
date.hour = 12U;
date.minute = 25;
date.second = 0;

RTC_StopTimer(RTC); // RTC time counter has to be stopped before setting the date & time in the TSR register
RTC_SetDatetime(RTC, &date); // Set RTC time to default

RTC_StartTimer(RTC); // Start the RTC time counter

 

0 Kudos