This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WDT problem

Other Parts Discussed in Thread: CC2500, SIMPLICITI, MSP430F2274

HELLO,
I HAVE A PROBLEM USING THE WDT IN THE MSP430
I'M WORKING WITH THE MSP430F2274 IN A WIRELESS DATA TRANSMISSION, I'M USING SIMPLICITI WITH THE CC2500 TRNSCEIVER
IN A VERY ELECTRICAL NOISING ENVIROMENT (INDUSTRIAL), SO THE PROBLEM BEGUN WHEN IN SOME CASE THE MSP430 GET FRIZZING
AND THE SISTEM STOP TO RECEIVE THE WIRELESS INFORMATION, SO IN ORDER TO REDUCE THIS PROBLEM I ENABLED THE MSP430
WATCHDOG SYSTEM.
IN THE CODE FIRST STOP THE WATCHDOG AND CLEAN THE COUNTER REGISTER, THEN ENABLE THE PERIFERALS I HAVE IN THE
BOARD (AN ETHERNET CONTROLLER AND THE CC2500 TRANSCEIVER) THEN I WAIT FOR A VALUE WIRELESS LINK TO BE MAKED
NEXT ENABLE THE TIMERS A AND B IN THE MSP430, THEN I ENABLE THE WATCH DOG USING THE VLO CLOCK IN THE ACLK USING
A PRESCALLER VALUE 8, IN ORDER TO MAKE A LONG TIME AS POSSIBLE.
I'M USING THE TIMER B SOURCE TO CLEAN THE COUNTER REGISTER EACH 500MS, THE PROBLEM IS WHEN A WATCHDOG REBOOT IS PERFORMED
IN SOME CASES THE MSP430 GET CICLED REBOOTING THE SYSTEM, I MEAN THE MSP430 REBOOT ITSELF ONE TIME AND AGAIN AND AGAIN
AND NEVER STOP TO REBOOTING, AS YOU CAN SEE IN THE CODE THE FIRST SENTENCE IN THE CODE IS STOP THE WDT SO
I HAVE NO IDEA OF WHAT IS HAPPENING.
DO YOU HAVE ANY IDEA OF WHAT COULD IT BE THE PROBLEM, BELOW YOU CAN SEE THE MAIN OF MY CODE AND THANK YOU IN ADVANCED.

void main (void)
{
  WDTCTL = WDTPW + WDTCNTCL +WDTHOLD + WDTNMI;
  P1DIR=0xFF;                                   //Set P1.0, 1  and 2 as outputs
  P1OUT=0xF4;                                   //set P1.2 to keep the eth module alive
 
  BSP_Init();                                   //Initialize the DCO and WDT
 

FCTL2 = FWKEY + FSSEL0 + FN1;                   //configure the MCU to flash writting
//wait for ETH controler to initialize itself
  wait (10000);

  //Search for free flash memory to write the event log
  search_addr_free();
  evento=REINICIO_RECEPTORA;
  //**************************************************
  // Store MCU initialization
  //**************************************************
  write_evento(evento);
 
  inicializar_UART();                           //UART configuration
 
  inicializar_eth();                            //AT comands to configure the ETH module
  TACCR0 = 50000;
 
  TACTL = TASSEL_2 + MC_2;                      //Timer A configuration for Leds events flags
 
  __bis_SR_register(GIE);                       //GIE
 
  SMPL_Init(sRxCallback);                       //SimpliciTI stack initialization

  if (!BSP_LED2_IS_ON())
  {
    toggleLED(2);                               //Turn of led 2
  }
 

  linkFrom();                                   //Wait for a succesful link
 
  BCSCTL1 |= DIVA_3;
  BCSCTL3 |= LFXT1S_2;                      // LFXT1 = VLO
  IFG1 &= ~OFIFG;                           // Clear OSCFault flag
 
  IE2 |= UCA0RXIE;                              // UART IE enabled
  TIMERB();                                     //TimerB configuration to perform events
  WDTCTL = WDTPW + WDTCNTCL + WDTSSEL + WDTIS0 + WDTNMI;
  __bis_SR_register(LPM0_bits + GIE);           //LPM0+GIE
}

  • First thing that comes to my mind when reading your post: Do you use large blocks of memory (buffers) which are initialized by the compiler to 0? If that is the case, then your first line of code (disabling WDT) might get executed with a lot of delay, sometimes enough for the WDT to kick in. If you are using IAR and need no initialization of the buffers, you can use the __no_init keyword.

    Second: In noisy inveronments, I discovered that the 10nF pulldown C on the Reset Line helps. TI recommends only 2.2nF for use with SBW (or their eval boards don't use it at all). So if you think that the Resets cause is EMI I would mount the C at first and see if that helps.

    Regards,
    Johannes

  • Hello, and tank you for your comments, and yes I´m using information buffres and yes they are initialized to zero, but if I put a break point on the line where I'm stopping the WDT, or afther that line I can reach the break point It means the WDT is stopped but any way the MSP reboot it self.

    In order to reproduce the oproblem and be hable to reproduce the error,I made a call in using a counter in order to clear the WDT counter an finite nuber of events and then force a PUC, afther the PUC the MSP430 get into extrange memory allocations and the initializations can't be done correctly ant that is the real problem, afther a reboot performed by the WDT the MSP430 get lost.

    Do you have any Idea of what can be happening?

    thank you

  • Hmmm... all I can do is just some wild speculations... maybe interrupts that are executed without IRQ Handler or interrupts that are executed to early? For example the follwing lines:

    __bis_SR_register(GIE);                       //GIE
      SMPL_Init(sRxCallback);                       //SimpliciTI stack initialization

    IRQs are already enabled, but the Callback is not set. If the IRQ Flag for that interrupt is already set, then you might find the processor running wild in memory (I am not familar with SimplciyTI, so I can't tell if that can be a problem)
    Regards,
    Hannes

**Attention** This is a public forum