K22 low voltage modes LVD / LVW. Interrupts and Resets.

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

K22 low voltage modes LVD / LVW. Interrupts and Resets.

1,116 Views
larrydemuth
Contributor III

I wan to be able to log (in flash) when the voltage drops into at least the warning level (better yet LVD level) and then have the micro enter reset.

It seems I can either have it enter LVD reset at this point OR get an interrupt and log the event and NOT reset.

For LVD reset (and no log) my settings are:

PMC_LVDSC1 = LVDRE,  set and high trip point set.

PMC_LVDSC2 = high trip point set.

This works great, even during a brown out. When power comes back up the I2C's and UART work fine. The only problem is I cant log it in my event log, which I want to be able to do.

For LVW Interrupt and logging, my settings are:

PMC_LVDSC1 = LVDRE set,  and low trip point set

PMC_LVDSC2 = LVWIE set,  and high trip point set

With this I can log the event, BUT it never goes into LVD reset during a brown out, so when power comes back up the I2C's and UART don't work. I tried changing the trip points for both but the result is always the same. If the power drops down low enough (maybe it goes to 0?), and then come back up, everything is OK, but not a brownout condition.

Is there some way I can get the LVD or LVW interrupt but also have it enter LVD reset when it reaches the LVD reset trip point?

Is there a way to force it to enter LVD reset? (I'm thinking no)

I tried forcing a software reset when getting an LVD interrupt but the I2C and UART are still messed up (not working) when power comes up from a brown out. I assume because its not held in reset until power comes back up to an acceptable level.

So to summarize what I want to do:

When power drops, somehow log the event in flash.

Have the micro enter LVD reset.

When power comes back up, exit LVD reset and restart the micro.

This must work for power loss and brownout also.

Tags (2)
0 Kudos
Reply
1 Reply

700 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Larry DeMuth:

I ran some tests with a TWR-K21F120 investigating your brownout scenario and I think what you want to achieve is not possible, or at least not with LVD. LVD reset and LVD interrupt cannot work together, is either one or the other, with the reset having more priority.

You may try instead to enable LVW (Low-Voltage Warning) interrupt, logging the event and then forcing a software reset from such interrupt, without waiting for the lower LVD threshold to reset the part. Then the chip would reset but start over with a higher voltage, so I2C and UART are functional.


Regards!,
Jorge Gonzalez

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

0 Kudos
Reply