K64 Low Voltage Detect

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K64 Low Voltage Detect

ソリューションへジャンプ
4,815件の閲覧回数
johnbaker
Contributor IV

I am trying to activate the Low Voltage detect on the K64 chip.  I have tried several variations of the control register configurations below but with no luck.  Does anybody know how to get the LVD_LVW interrupt to fire when the voltage drops below 3.1v?

PMC_LVDSC1 =  PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(1);

PMC_LVDSC2 =  PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(3);

void LVD_LVW_IRQHandler(void) {

}

Thanks,

John Baker

ラベル(2)
タグ(4)
1 解決策
4,246件の閲覧回数
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello John Baker:

I think you are missing to enable the LVD/LVW interrupt vector from the NVIC module, apart from enabling the interrupts in the PMC module. Also, as noted in the Reference Manual, the LVWF flag may be 1 after power-on reset, so you must clear it by writing 1 to LVWACK.

Try with this code:

    PMC_LVDSC1 =  PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(1);

    PMC_LVDSC2 =  PMC_LVDSC2_LVWACK_MASK | PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(3);

    NVIC_EnableIRQ(LVD_LVW_IRQn);

Then as noticed by Alice the voltage threshold with these settings is not exactly 3.1 V, but 3V for Low Voltage Warning and 2.56V for Low Voltage Detect.


Regards!,
Jorge Gonzalez

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

元の投稿で解決策を見る

4 返答(返信)
4,247件の閲覧回数
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello John Baker:

I think you are missing to enable the LVD/LVW interrupt vector from the NVIC module, apart from enabling the interrupts in the PMC module. Also, as noted in the Reference Manual, the LVWF flag may be 1 after power-on reset, so you must clear it by writing 1 to LVWACK.

Try with this code:

    PMC_LVDSC1 =  PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(1);

    PMC_LVDSC2 =  PMC_LVDSC2_LVWACK_MASK | PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(3);

    NVIC_EnableIRQ(LVD_LVW_IRQn);

Then as noticed by Alice the voltage threshold with these settings is not exactly 3.1 V, but 3V for Low Voltage Warning and 2.56V for Low Voltage Detect.


Regards!,
Jorge Gonzalez

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

4,240件の閲覧回数
johnbaker
Contributor IV

Jorge,

This worked like a champ! 

The interrupt fires at 3.06v and my critical backup to flash takes around 600 us.  Life is good again! :-)

Thanks,

John Baker

4,240件の閲覧回数
johnbaker
Contributor IV

Thanks Alice and Jorge.  I will try this.  Our chip runs at 3.3v.

Alice, the Datasheet 2.2.2 page looks same as what you posted.

Jorge,  I will try your code sample out and let you know how it works for me.

Thanks again!

John Baker

0 件の賞賛
返信
4,240件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello John,

What is your voltage of low voltage ? It is not only under 3.1 the low voltage can detected.

You can find information regard VLVDL and VLVDH on the K4 datasheet :

2.2.2 LVD and POR operating requirements ->

pastedImage_0.png

pastedImage_1.png

Please check the voltage of your chip .


Have a great day,

Alice

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

0 件の賞賛
返信