Dear community,
Unfortunately I’m facing a problem that I’m not able to solve. Maybe somebody of you can give me a clue…
I’m coding in CCS v5 the device MSP430F2232 via the eZ430-RF2500.
The complete program is shown below. If I run the program with
//ADCon ADC0(0, 1, 65, 740, 829, 859, 1);
ADCon ADC1(1, 1, 65, 767, 829, 859, 1);
ADCon ADC2(2, 1, 65, 785, 829, 859, 1);
ADCon ADC3(3, 1, 65, 730, 829, 859, 1);
ADCon ADC4(4, 1, 65, 767, 829, 859, 1);
//ADCon ADC5(5, 1, 61, 726, 803, 846, 1);
/*ADCon ADC6(6, 1, 65, 767, 829, 859, 1, "cm");
ADCon ADC7(7, 1, 65, 767, 829, 859, 1, "cm");*/
Everything works fine. If I add one more class like
//ADCon ADC0(0, 1, 65, 740, 829, 859, 1);
ADCon ADC1(1, 1, 65, 767, 829, 859, 1);
ADCon ADC2(2, 1, 65, 785, 829, 859, 1);
ADCon ADC3(3, 1, 65, 730, 829, 859, 1);
ADCon ADC4(4, 1, 65, 767, 829, 859, 1);
ADCon ADC5(5, 1, 61, 726, 803, 846, 1);
/*ADCon ADC6(6, 1, 65, 767, 829, 859, 1, "cm");
ADCon ADC7(7, 1, 65, 767, 829, 859, 1, "cm");*/
The program seems to break within the while loop and restarting from the beginning. It seems like there would be a watchdog reset. But the watchdog is supposed to be deactivated (Control register shows a “1” for hold).
Does somebody have a clue?
How could I find out if it’s a watchdog reset?
Thanks in advance for any help, happy new year and kind regards, Christoph
intmain(void) {
WDTCTL = WDTPW + WDTHOLD + WDTCNTCL ; // Stop watchdog timer
BCSCTL1=CALBC1_12MHZ; // Internal clock 16MHz
BCSCTL2=0x00;
BCSCTL3=0x00;
DCOCTL=CALDCO_12MHZ;
P1DIR = 0xFF; //Configuration of all Ports
P2DIR = 0xC7;
P3DIR = 0x3E;
P4DIR = 0x87;
P1SEL = 0x00;
P2SEL = 0x18;
P3SEL = 0xCA;
P4SEL = 0x78;
P1IE = 0x00;
P2IE = 0x00;
P1OUT = 0x00;
P2OUT = 0x00;
P3OUT = 0x00;
P4OUT = 0x00;
SPI_Init(); //Initialization Display
DISP_Init();
DISP_Clean();
AD_Init(); //Initialization of AD Converter
//ADCon ADC0(0, 1, 65, 740, 829, 859, 1);
ADCon ADC1(1, 1, 65, 767, 829, 859, 1);
ADCon ADC2(2, 1, 65, 785, 829, 859, 1);
ADCon ADC3(3, 1, 65, 730, 829, 859, 1);
ADCon ADC4(4, 1, 65, 767, 829, 859, 1);
ADCon ADC5(5, 1, 61, 726, 803, 846, 1);
/*ADCon ADC6(6, 1, 65, 767, 829, 859, 1, "cm");
ADCon ADC7(7, 1, 65, 767, 829, 859, 1, "cm");*/
TA0CTL = 0x0234; //Timer A Control Register - Timer A creates 10ms Interrupt
TACCR0 = 0xE597; //Measured value for realizing correct 10ms Interrupt
TACCTL0 = 0x0010;
TB0CTL = TBSSEL_2 + MC_2 + TBCLR;
_enable_interrupts();
unsignedchar Test[8]={5,5,5,5,5,5,5,5};
while(1)
{
TB0CTL |= TBCLR;
P2OUT |= 0x04;
Frame(1);
show_watch(7, 20);
AD_Collect(AD);
Num_Str(ADC4.ADvalue_Real, Test);
DISP_WriteString(12,20,Test);
Num_Str(ADC4.ADvalue_Stan, Test);
DISP_WriteString(15,20,Test);
Num_Str(ADC4.ADvalue_Con, Test);
DISP_WriteString(18,20,Test);
Num_Str(ADC1.ADvalue_Stan, Test);
DISP_WriteString(15,80,Test);
Num_Str(ADC2.ADvalue_Stan, Test);
DISP_WriteString(18,80,Test);
Num_Str(ADC3.ADvalue_Stan, Test);
Num_Str(ADC4.ADvalue_Stan, Test);
ADC1.Average(AD);
ADC2.Average(AD);
ADC3.Average(AD);
ADC4.Average(AD);
ADC1.Calculate();
ADC2.Calculate();
ADC3.Calculate();
ADC4.Calculate();
}
return 0;
}
/*******************************************************************
* Timer A Interrupt Vector Handler
* Time calculation: T = 2/12MHz * (TACCRO+1) = 10ms
*******************************************************************/
#pragma vector=TIMER0_A0_VECTOR
__interruptvoidTIMER_A(void) //10ms Interrupt
{
TA0CTL = TA0CTL & 0xFFFE;
RTC10 += 1;
if(RTC10 == 10) //100ms Interrupt
{
RTC10 = 0;
RTC100++;
}
if(RTC100 == 10) //1s Interrupt
{
RTC100 = 0;
RTC1000++;
watch();
}
return;
}