Hi,
I am trying to run my msp430f2232(mclk) at the frequency 16MHz, however it continuously gets reset, and goes to NMI_ISR routine(the value of IFG1 is 0x06, power on interrupt + oscillator fault) .
The code as follows:
#include "msp430x22x2.h"
unsigned char g_ucTemp = 0;
void main(void)
{
WDTCTL = WDTPW +WDTHOLD; // Stop Watchdog Timer
BCSCTL1 = CALBC1_16MHZ; // Set DCO to 16MHz
DCOCTL = CALDCO_16MHZ;
IE1 |= OFIE;
__bis_SR_register(GIE);
while(1)
{
g_ucTemp = g_ucTemp;
}
}
#pragma vector=NMI_VECTOR
__interrupt void NMI_ISR (void)
{
g_ucTemp = IFG1;
if(g_ucTemp & OFIFG)
{
g_ucTemp = g_ucTemp;
}
}
I run the same code on msp430f2013, at the beginning it goes to NMI_ISR only one time, then it runs correctly.
And I want to add an additional thing different from this topic. Previously I tried to make comminication between msp430f2232(slave) and an another MCU(LM3S9B92) by using USCI.SPI interface, the msp430f2232 was also getting reset when I reset LM3S9B92 device.
What could be cause of this problem?