Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG
I am trying to get the NMI_Handler to reset the device. I have set the brownout level to 3. during debug and also with debugger detached i do not see the reset
the main is setup to turn the led on for a couple seconds then turn off. at that point I lower the voltage to 2.1V. i do not see the reset with the leds turning back on for a couple seconds again
I have pasted the main code here. Would really appreciate any help. Thanks
SYSCONFIG_WEAK void SYSCFG_DL_init(void)
{
SYSCFG_DL_initPower();
SYSCFG_DL_GPIO_init();
/* Module-Specific Initializations*/
SYSCFG_DL_SYSCTL_init();
SYSCFG_DL_SPI_0_init();
SYSCFG_DL_SYSTICK_init();
SYSCFG_DL_WWDT0_init();
/* Ensure backup structures have no valid state */
gSPI_0Backup.backupRdy = false;
}
SYSCONFIG_WEAK void SYSCFG_DL_SYSCTL_init(void)
{
DL_SYSCTL_setSYSOSCFreq(DL_SYSCTL_SYSOSC_FREQ_BASE);
//Low Power Mode is configured to be SLEEP0
DL_SYSCTL_setBORThreshold(DL_SYSCTL_BOR_THRESHOLD_LEVEL_3);
}
void INTERRUPT_Initialize (void)
{
// Interrupt prepare
NVIC_ClearPendingIRQ(SPI_0_INST_INT_IRQN);
NVIC_EnableIRQ(SPI_0_INST_INT_IRQN);
}
int main(void)
{
SYSCFG_DL_init();
INTERRUPT_Initialize();
DL_SYSCTL_activateBORThreshold();
int ii = 0;
while(ii++ < 1000000)
{
DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_2_PIN);
}
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_2_PIN);
while(1);
}
void NMI_Handler(void)
{
DL_SYSCTL_NMI_IIDX value = DL_SYSCTL_getPendingNonMaskableInterrupt();
switch (value)
{
case DL_SYSCTL_NMI_IIDX_BORLVL:
DL_SYSCTL_resetDevice(DL_SYSCTL_RESET_POR);
break;
default:
break;
}
}