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!
-----------------------------------------------------------------------------------------------------------------------