Processor Expert settings for Low Voltage Detect Interrupt?

cancel
Showing results for 
Search instead for 
Did you mean: 

Processor Expert settings for Low Voltage Detect Interrupt?

673 Views
dominikf
Contributor II

Hei,

we are trying to get the Low Voltage Detect Interrupt to work on the FRDM-KL26Z development kit, but no matter what settings we choose, the irq does not seem to fire.

Below are the settings for LVD in PEx:

Screenshot - 5_6_2015 , 2_46_01 PM.png

And the service routine in Events.c - the "lowVoltage" is a flag that gets checked in the application:

void Cpu_OnLowVoltageINT(uint8_t Reason)

{

  /* Write your code here ... */

    PMC_LVDSC2 |= PMC_LVDSC2_LVWACK_MASK;

    lowVoltage = TRUE;

}

The "Cpu_OnLowVoltageINT" event is enabled in the CPU module:

Screenshot - 5_6_2015 , 2_49_51 PM.png

Could someone provide a screenshot of working LVD settings in PEx ?

Thank you in advance for the help!

Dominik

Tags (4)
0 Kudos
8 Replies

203 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Dominik,

Please try disalbe "LVD reset" , and enable "Interrupt requesst " .

pastedImage_0.png

BR

Alice

0 Kudos

203 Views
dominikf
Contributor II

Hei Alice,

we had tried the settings that you described as well, but without any luck. Would you have another idea of what we could try?

This is the settings as they are now:

L_EA10.tmp.jpg

Best regards,

Dominik

0 Kudos

203 Views
mike_susen
NXP Employee
NXP Employee

Hi Dominik,

Settings for LVD interrupt seems fine. But you cannot check LVD flag in your code because LVD flag is checked and cleared in Cpu.c code:

PE_ISR(Cpu_INT_LVD_LVWInterrupt)

{

  uint8_t Reason = 0x00U;              /* Defines the source of Low voltage interrupt */

  if ((PMC_LVDSC1 & PMC_LVDSC1_LVDF_MASK) != 0x00U) {

    PMC_LVDSC1 |= PMC_LVDSC1_LVDACK_MASK;

    Reason |= LVDSRC_LVD;

  }

  if ((PMC_LVDSC2 & PMC_LVDSC2_LVWF_MASK) != 0x00U) {

    PMC_LVDSC2 |= PMC_LVDSC2_LVWACK_MASK;

    Reason |= LVDSRC_LVW;

  }

  Cpu_OnLowVoltageINT(Reason);

}

So you can only check the Reason valuein Cpu_OnLowVoltageINT(uint8_t Reason) function. Reason value may acquire 0x00U or one of these two values.

#define LVDSRC_LVD        0x01U        /*!< Low voltage detect       */

#define LVDSRC_LVW        0x02U        /*!< Low-voltage warning      */

Best regards

Michal

0 Kudos

203 Views
dominikf
Contributor II

Hei Michal,

thanks for the input. Actually we were not even checking the LVD flag, but instead just setting our software flag in the interrupt service routine. The ISR just seems to never get called.

PW_low_level_init should enable LVWIE, so we still didn't figure out why the IRQ never fires.

  /* PMC_LVDSC2: LVWACK=1,LVWIE=1,LVWV=3 */

  PMC_LVDSC2 |= PMC_LVDSC2_LVWACK_MASK |

                PMC_LVDSC2_LVWIE_MASK |

                PMC_LVDSC2_LVWV(0x03);

Best regards,

Dominik

0 Kudos

203 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Dominik,

The LVD interrupt is invoked when the supply voltage decrease below the set limit (see http://cache.freescale.com/files/microcontrollers/doc/data_sheet/KL26P121M48SF4.pdf?fasp=1&WT_TYPE=D... , chapter 2.2.2 LVD and POR operating requirements).

How you regulate the supply voltage and how you detect the interrupt service routine invocation? Do you regulate voltage of the KL26Z silicon or the whole FRDM-KL26Z board?

Best Regards,

Marek Neuzil

0 Kudos

203 Views
dominikf
Contributor II

We regulated the supply voltage with a seperate power supply, which was connected to the MCU only.

As indication we switched on an LED in the Interrupt service routine.

We never got this feature to work, and now abandoned the idea. It would have been a nice feature to have!

Best regards,

Dominik

0 Kudos

203 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Dominik,

I see two possible reasons of your issue:

- The bandgap buffer is disabled in your configuration of CPU (there is not any statement about the bandgap buffer usage by LVD in the refernce manual but the LVD can use the bandgap buffer for detection of the low voltage).

- The MCU supply voltage is regulated by an independent power source but other circuits (peripherals connected to the MCU) are supplied by a stable source of Vdd (3.3V). The MCU can be powered by these connected devices and the LVD detection circuit are not able detect the low voltage of MCU power supply. You should regulate voltage of the MCU and all connected circuits to detect the low voltage by the LVD device.

Best Regards,

Marek Neuzil

0 Kudos

203 Views
dominikf
Contributor II

Hei Marek,

thanks for the input, it is much appreciated.

Indeed the bandgap buffer is disabled. We will try this and report back, although it might take a bit until we have the time to do so.

Best regards,

Dominik

0 Kudos