How to detect Low voltage on K64 using Processor expert?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect Low voltage on K64 using Processor expert?

184 Views
Contributor III

Hi ,

I am working on K64FN controller with KDS 3.2.0. I would like to detect low voltage on K64 for writing data to flash to protect it from being erase on power on reset. I am using processor expert for my project. I have tried the below configuration from link 

K64 Low Voltage Detect 

 

  1. PMC_LVDSC1 =  PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(1);  
  2. PMC_LVDSC2 =  PMC_LVDSC2_LVWACK_MASK | PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(3); 

Also I have made changes in unhandled vector from Build option of the CPU component to Own handler for every, so that I can check if LVD interrupt occurred. I did debug this by using J-link debugger. When I decreased the voltage below 3.1 V, it is showing me message that No source available at 0x00 and it is not going to the LVD_ISR. 

My question is how to get the LVD  interrupt fire in my code? 

Any help is appreciated.

Thank you,

Kirti

0 Kudos
3 Replies

56 Views
NXP TechSupport
NXP TechSupport

Dear Kirti,

Only to confirm the debugger is not working correctly, could you toggle a pin or do something visible in the interruption and run your code without the debugger?

Best Regards,

Alexis Andalon

0 Kudos

56 Views
Contributor III

Hello Alexis,

Thank you for the reply.

Yes, the debugger is working fine. I have toggled the pin in interrupt and it worked for me. The problem was, I could not link the LVD handler function in the vector table. That's why the interrupt did not fire. I found out the component in processor expert to add the user interrupt.  By using this component I could add the user interrupt to vector table.

I have followed below link to use the PE component.

Tutorial: User Interrupts with Processor Expert | MCU on Eclipse 

Thanks again for the help.

Kirti

0 Kudos

56 Views
NXP TechSupport
NXP TechSupport

Hi Kirti,

Thanks for sharing you solution. I'm glad that you could solve your issue.

Best Regards,

Alexis Andalon

0 Kudos