K24 RTC

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

K24 RTC

1,132 Views
johnduplessis
Contributor I

Can anyone tell me if it is still possible to use the RTC if the VBAT pin on a K24 processor is left unconnected?

Many thanks

John

Tags (3)
0 Kudos
6 Replies

749 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello John Du Plessis:

The RTC is powered by VBAT, so you cannot leave the VBAT unconnected when using RTC. Also if you try to access RTC registers while VBAT is not present it causes a bus error.


Regards!,
Jorge Gonzalez

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

0 Kudos

749 Views
francoismace
Contributor II

Hello Jorge,

Related to your answer, I am wondering if there is any solution to find if the battery is present or not.

We have indeed a similar problem here on our K60 device: we do not have a battery for say connected but we use a capacitor that gets charged when our board is connected on the power supply and which allows us to power the RTC for a few days if the card was ever disconnected from the main power.

We run µCLinux with our Kinetis controller and, during the initialization of the OS, we try to access the register to get our time reference correct. Since this capacitor takes 2 minutes to get charged to a sufficient value, the card keeps rebooting (due to the processor exception) during these two minutes until we can successfully acces the RTC registers and continue the boot process.

We could add an external sensing circuit and report the status of VBAT on an IO but it would require specific changes to the hardware that I would rather avoid.

Thank you in advance for your feedback it would greatly be appreciated.

Best regards,

Francois

0 Kudos

749 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Francois,

There is also Time Invalid Flag that can be used for indication of the RTC state. When you have RTC battery disconnected and you executed initialization (after power on reset) the Time Invalid Flag is set. See also the description in the reference manual:

The time invalid flag is set on VBAT POR or software reset. The TSR and TPR do not increment and read as zero when this bit is set. This bit is cleared by writing the TSR register when the time counter is disabled.

Best regards,

Marek Neuzil

0 Kudos

749 Views
francoismace
Contributor II

Hello Marek,

Thank you for your answer.

The main issue I get is actually to get access to all of these registers giving a possible status on the RTC or of VBAT.

Indeed, my "Battery" powering VBAT is actually a large capacitor that charges first when the board is powered on and which is able to retain sufficient power to the RTC for up to 3 days. It takes between 1 and 2 minutes to get it fully charged (depending on the tolerance on the components and on the actual power supply voltage applied to the board).

The problem with the solution you proposed is, I think, that the RTC_SR not being an access control register of the RTC, it is not accessible when the VBAT voltage is under the acceptable value to actually power up the RTC. Therefore if I try to access it (during the boot phase of linux) I will receive a bus error.

I guess the ideal would be to have an access to a register powered by the general power supply of the chip which would give us a status on VBAT (directly or indirectly with a method such as the one you proposed) to know whether or not I can make an attempt to access one of the VBAT powered register.

Regards,

Francois

0 Kudos

749 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Francois Mace:

There is not a internal status for the VBAT pin state.

Common suggestion is to use an ADC input to monitor the VBAT level.

Regards!

Jorge Gonzalez

0 Kudos

749 Views
francoismace
Contributor II

Hello Jorge,

Thank you for your quick answer.

I guess I probably will have to modify our board design if we ever want to solve that issue then.

A quick complementary question tough since this question arose before I received your answer.

I saw in the DryIce part of the user manual that, in the DRY_SR register, the VTF bit (address 4) states that "... this flag is set when the VBAT voltage is outside the valid range". However, according to the documentation, this register is powered from VBAT (since it is not one of the two access control registers).

Can you clarify whether or not this register is indeed powered under VBAT and if it could be used (or not) to get an image of the validity of VBAT?

0 Kudos