How to turn off / disable the internal RTC if MCU is connected to external battery?

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

How to turn off / disable the internal RTC if MCU is connected to external battery?

1,925 Views
mci
Contributor III

Hello,

I'll be developing a new product using the MKL28Z512VLL7 MCU.

I have browsed through MKL28ZRM.pdf but I don't see > a way in firmware how I can turn off / disable the internal RTC of an MCU that is connected to external battery, when the whole system is powered off / unplugged from A/C outlet?

The situation is this: after manufacturing & testing, the coin cell battery will be kept on the board without a removable disconnecting tab or tape, when storing the product on the shelf. We cannot have a removable battery tab or tape to disconnect the battery because the customer will NOT have access to the board inside the product. The internal RTC will use up the battery if it remains ticking when everything else is powered off.

I know when & how to detect when I need to turn the RTC off (after manufacturing test) & when & how to detect when I should enable it & let it start normal RTC operation.  But can it be disabled or turned off & remain off in firmware (which MCU register, port, bit setting) before full system shutdown even if there's coin battery connected to the MCU?


Is there a way I can execute in FW the disabling of the   internal RTC module (which MCU register, port, bit setting) before the whole system is powered-off through any of MKL28's registers or ports?

I need to do this in order to conserve battery life considering we can't know when the product will be bought & used by a customer.

Thanks for the help.

MI

Labels (1)
6 Replies

1,678 Views
mci
Contributor III

Hi Mark and Ricardo,

Mark, Thank you for the info & the links.   I'll definitely read through them.

I may not be explaining the situation very well mainly because I'm still very new in using the MCU MKL28Z & still learning.  Please read other explanation below.

Ricardo,  you made me realize I might be mistaken in the approach & resolution to what I need to accomplish.

The main goal is (as Ricardo asked), even when a coin cell battery is plugged in to the HW circuit, if the product is completely powered off, let's say it's in a box stocked-up on a retailer shelf, I do NOT want any of the HW circuit or the MCU drawing any power from the connected coin cell battery.  No, I don't want to set it in any low power mode while it is boxed on a shelf.   I need ALL circuits OFF, even with coin battery installed on the board.  (Again, we can not have removable tab on the cell because product will be sealed & customer can not reach inside to retract the tab.)

One issue is this MKL28 does not have a "VBAT" input pin as how it is with another MCU Kinetis K22F which we are using on an old product.   The K22F on that product is where we have connected the battery to the VBAT pin & according to this MCU's reference manual, that VBAT pin only supplies power to the RTC and some config block 32 byte "files" while the rest of the MCU is "dead".  So even when powered down, the product keeps date & time because RTC "ticking".

I want to apply the same principle to the MKL28-based new product I'm developing.   In this early stage of HW circuit design, I've recommend to our HW engineer (I'm more in FW engineering) to connect the battery circuit to the VDD which if the system is powered-down will mean the coin battery will supply back-up power to the WHOLE SYSTEM, & not just the RTC.   This means I have to constantly keep the MCU in lowest power mode even if the product is inside a box on a shelf?  which does not make any sense.    I need the whole MCU powered-off if main power is taken-out even if coin battery is installed.   So that's why I only wanted to turn off RTC if in case the battery is only supplying power to it (not the whole MCU).

I just found the VOUT33 pin on MKL28.   It is mentioned mainly in the context of the "USB", not so much for RTC backup power ala-K22F.  We are not implementing a USB communication at this point for this product.  Refman says keep VREGIN & VOUT33 floating if not to be used.

   Does anyone know if the VOUT33 on the MKL28 can be utilized / programmed / connect like the the VBAT on the K22?  which pin or crystal or what have you should I connect VOUT33 to so it supplies power ONLY TO RTC peripheral but NOT the whole MCU (need to be shutdown).   So if product is the box, I'll just "DISABLE" the RTC via CGC bit on PCC_RTC register.  Which I hope will ensure NONE of the MCU & HW circuit will consume any coin battery life.

Please correct me if any of the above I said is incorrect & please explain if you have what other options/solutions I can do both in HW circuit connection & my FW programming to accomplish my goal.

Thank you so much for the help.

MI

0 Kudos

1,678 Views
mjbcswitzerland
Specialist V

Hi MI

VOUT33 is the output of a 5V/3.3V regulator in the chip which is used mainly for powering the USB transceiver (although it can be used to power the complete CPU from 5V). It has no relation to the RTC and also has typically 0.65us quiescent current.

There is no battery backup domain (VBAT) on the KL28 so you have only the option to power the complete processor or completely remove the power. If you power the chip you need to define its operating state - the default will be RUN and it will consume a couple of mA of current. You can get lowest consumption (around 500nA) if a very low leakage mode is set (by the code running on the chip) but you will not get 0nA.

If you need zero current consumption you need to use a chip with a VBAT domain or have a physical was of removing the battery.

Regards

Mark

1,678 Views
mci
Contributor III

Hi Mark,

Thanks for your reply.

We have decided to accept the minimum leakage current at the very lowest power comsumption "stop mode" according to the MKL28Z which is VLLS0 where about 331 nA will be occurring because other internal peripherals are up such as RTC, TSI, LLWU, etc.   I hope to save even more if I do DISABLE all or most of those available modules like what was discussed above - by setting CGC bit off/on, even the TSI and all others that can be disabled with a bit setting to their corresponding control registers, especially when I know the product is inside a box and not being used at all.   Also if we use coin cell battery CR2032 which has about 231 mAHr, given the 331 nA usage/leakage current, theoretically this battery will last ~77 years if our computation is correct.

For now, that is settled matter, until I get back to it and find some other issue.

Thanks to all who help.

Regards,

MI

0 Kudos

1,678 Views
nxf51211
NXP Employee
NXP Employee

Hi,

I would like to ask you if by shutting the whole system down it means that you are "cutting" the power through VDD or do you mean something else? Also, I would like to ask you where are you connecting the battery to your board in order to do what you are describing.

 

Regarding your last comment, you can indeed "turn off the RTC" with the CGC field of the PCC_RTC. This would disable the clock of the RTC and therefore will make it stop.  

Best Regards,

Ricardo Delsordo

0 Kudos

1,678 Views
mci
Contributor III

P.S. Follow-up:

 

I read through the MKL28 reference manual some more & I think I found the register that I can manipulate to “turn off the RTC”.

 

Is this correct register to use in programming the RTC?   Anybody has tried this?

PCC RTC (PCC_RTC)

bit 31 (PR):          0 = peripheral is not present

                              1 = peripheral is present

bit 30 (CGC):       0 = clock is disabled

                              1 = clock is enabled

bit 29 (INUSE):    0 = peripheral is not being used

                              1 = peripheral is being used

Please advise.

Thank you.

MI

0 Kudos

1,678 Views
mjbcswitzerland
Specialist V


Hi MI

The PCC is used to enable clocks for RTC access but not to control the 32kHz crystal oscillator.
The crystal can be enabled or disabled (after enabling PCC clocks) in the RTC_CR register.

If I understand correctly you will be supplying the processor with power from a battery and your power-down state will be the processor set to a very low leakage power mode to get lowest current (eg. around 2uA with RTC in operation) until turned on via a LLWU input.
In your initially delivery state you don't want the 32kHz oscillator/RTC working yet to further reduce the current (eg. around down to around 0.5uA) to maximise shelf life.


See also http://www.utasker.com/kinetis/KL_RTC.html for discussion of RTC on general KL parts - not fully valid for the KL28 since it doesn't have an RTC_CLKIN pin.
Also note that this support and operation is available in the uTasker project as standard capability.

Does this correspond to your design objectives or have you a different approach?

For low power modes an LLWU see also http://www.utasker.com/kinetis/LLWU.html
and some low power videos:
- https://youtu.be/kWNlsAoMly4
- https://youtu.be/iZEMRiDmHzw
- https://youtu.be/v4UnfcDiaE4

Regards

Mark

Complete KL28 solutions, training and support for faster time-to-market: http://www.utasker.com/kinetis.html
- http://www.utasker.com/kinetis/FRDM-KL28Z.html

0 Kudos