Kinetis Comparator Issue in VLPR

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

Kinetis Comparator Issue in VLPR

786 Views
lfschrickte
Contributor IV

Hi,

I'm having trouble using CMP0 in Very Low Power Run mode on Kinetis KL14. The purpose of my circuit is to detect Power fails. If the power falls below some threshold, I choose a slower clock config and enter VLPR mode. When the power rises again, I exit VLPR and restore my original clock config. My back up power comes from a CR2032 battery, so I do need to save as much energy as I can when main power isn't available. The purpose is to keep the RTC running.

The problem is: I can detect the falling edge successfully and enter VLPR, however it looks like in VLPR the CMP0 is not working, because even restoring the power the Analog Comparator output is always 0 and I don't detect the event to exit VLPR!

My comparator is set to low power mode, and the comparison is using as negative input the bandgap voltage. I've already set in Processor Expert the Bandgap voltage to keep available on Low power modes, and also set the CMP0 to run in this condition. What am I missing?

Facts:

- if I don't enter VLPR, just change my clock configuration to a slower clock, everything works fine

- if I use another event (like some delay, or counter overflow) to reenter RUN mode everything works fine. The problem is with the comparator.

- I've configure Processor Expert to enter VLPR only when asked by the user, and I've disabled the interrupt wakeup (tried it enabled already, without success)

There is a lot of things I've tried and config options I've changed - without success :smileysad: Please ask me if there is some information missing. The specific MCU I'm using is a MKL14Z64VFM4.

Is there any restrictions on CMP0 use when in VLPR mode?

Thank you very much!

Tags (3)
2 Replies

336 Views
Paul_Tian
NXP Employee
NXP Employee

Hi, Luiz

As you mentioned, the potential mistakes you are all cared. So if possible, would you please help to send your project? I will help to check your setting? Thanks.

Best Regards

Paul

0 Kudos

336 Views
lfschrickte
Contributor IV

Thank you Paul!

Actually I can't share my application code - company issue. I'm going to start a new project with the same settings + sample code and test here with my board to reproduce the problem. Then I can share the code... but I'm really busy right now, so maybe I'll need a couple weeks to have time and do this.

I've solved my problem the easy way: changed the reference to the DAC ref and everything is working fine! This proved me the code was OK, and I was having some problem with the bandgap buffer - and I can assure you the bandgap buffer was enabled (besides having it checked on PE interface I've checked the code generated!)

As soon as I have time I'm going to supply you with a sample code to demonstrate the issue.

Thank you very much for your reply!