RTC and Sleep-Mode

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

RTC and Sleep-Mode

1,485 Views
astdom01
Contributor III

Dear all

I just started useing Kinetis L25 Controller with ProcessorExport. Now I face a Problem when I try to use the Sleep-Mode with a running RTC.

I have an auto-initializing RTC-Component which is running well.

I have "Very low power modes" and "Low leakage stop mode" allowed in "Cpu/Low power mode Settings/Allowed power modes".

I have all Settings disabled in "Cpu/Low power mode Settings/LLWU Settings/Settings" even "RTC" and "RTC_Seconds"

(See image below)

I Switch to the sleep-mode with the following command:

Cpu_SetOperationMode(DOM_SLEEP, NULL, NULL);


Without RTC I remain in sleep-mode forever. With the RTC enabled I just wake up again with ERR_OK as return code. I do not really understand this behaviour because RTC and RTC_Seconds are disabled in the LLWU settings. Can anyone give me a hint what is happening here?

Thank you for any help .. Dominic


llwu_settings.png

Labels (1)
0 Kudos
5 Replies

934 Views
astdom01
Contributor III

Hm, I think I found my mistake partly.. when I use DOM_SLEEP I use VLPS mode and not LLS mode as I expected. In VLPS mode LLWU is not used and therefore LLWU configuration has no effect (as I understand). Instead AWIC is used and that explaines why the controller wakes up on RTC interrupt.

In this sense my program behaves as expected now - as long as I use the debugger to run it. When I flash the programm and power the device without debugger attached it remains in sleep mode and does not wake up. That's very strange! I hope to find this problem too.


Thank you for any hint. Best regards, Dominic

0 Kudos

934 Views
yasuhikokoumoto
Senior Contributor I

Hi Dominic-san,

almost all MGC clock would stop in the low power mode. You could choose LPO as the CLKOUT because LPO did not stop even in the low power mode. However in the case, the clock loop-back would not be needed because LPO could directly drive RTC. The only disadvantage to use LPO, the time would be longer by 32 times because LPO runs at 1kHz. Do this help you?

Best regards,

Yasuhiko Koumoto.

934 Views
adriancano
NXP Employee
NXP Employee

Hi,

You need to check that the source clock your are using for the RTC module is also enable in VLLSx mode, also depends on the VLLS mode you are entering.

note.jpg

You can refer to the Table 5-1 Clock Summary of the Reference Manual to see which clock are enable in VLLSx modes; also refer to the Table 7-1 Chip power modes there you can find specific information for each mode.

I hope this information can help you.

Regards,

Adrian

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

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

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

0 Kudos

934 Views
astdom01
Contributor III

Thank you for your reply .. I think I am on the trace! I use the hack where the 32 khz is looped back from PTC3 to PTC1 as described here:

https://community.freescale.com/docs/DOC-94734

And I use LLS mode (DOM_STOP and Low power mode settings/Operation mode settings/Stop operation mode = LLS ) but the RTC clock generation does not work when the controller is sleeping. I think this does not work in LLS mode because the output pins are latched.

Is it true that I need to use an external 32 khz clock generator for the RTC if I want to use it in LLS mode?

Thx, Dominic

0 Kudos

934 Views
adriancano
NXP Employee
NXP Employee

Hi,

I hadn't done it but regarding the Reference manual also the LPO can be selected as the ERCLK32K clock source, check the comments on the https://community.freescale.com/docs/DOC-94734 document. Some members present a different way to use the RTC.

rtc clock.jpg

The LPO clock remains on VLLS3 mode.

I hope this information can help you.

Regards,

Adrian

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

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

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