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.

MSP430F67791A: Triggering SDADC24B channels by TA0.A1 output

Part Number: MSP430F67791A

Hello All, 

I am trying to set up the controller such that I am able to trigger 3 channels of SDADC24B module via the Timer A0 Capture/Compare 1 output. 

Timer A0 is sourced from the SMCLK clock @8MHz and is set up in the Up counting mode with a period of 1mS. 

The TA0.A1 output is set up to provide a compare output i.e. TA0.A1.CCIFG flag is programmed to be set at 25µS period after the Timer resets on reaching the 1mS period. 

On the other side the SDADC24 channel 0, 1, 2 are set up to be simultaneously triggered by the Trigger 1 input. 

To trace I enabled the CCIE 1 interrupt but I am not getting any interrupts.

It just doesnt seem to be working. What am I doing wrong? My code is added below:

void Init_Timer0(void)
{
	TA0CTL   = TASSEL__SMCLK + MC_0  	// Stop & Clear Timer, Clock input
			 + ID_0 + TACLR;			// set as SMCLK, No divisor
	TA0CCR0  = COUNT_1MS;				// 7.995 MHz / 7995
	TA0CCR1	 = 200;						// TA0.A1 output triggers SDADC
	TA0CCTL1 = CCIE + CM_0 + CCIS_2;	// CCI interrupt enabled, CCI is grounded.
	TA0CCTL1 &= ~CAP;					// Compare mode enabled
	TA0CTL	|= MC_1;					// Start counting Up
}

void Init_SDADC24(void)
{
	SD24BCTL0 = SD24SSEL__SMCLK + SD24PDIV_0 +      // ADC CLK = SMCLK/16, Internal Ref
				SD24DIV2 + SD24DIV1 + SD24DIV0 +
				SD24REFS;						    // SMCLK = MCLK/2 &OK AMP

	SD24BINCTL0 = SD24INTDLY_0 + SD24GAIN_1;		// G=1 Interrupt on 4th Samp
	SD24BCCTL0 = SD24SNGL + SD24DF_1 + SD24SCS__EXT1;    // External Trigger 1
	SD24BOSR0 = OSRCNT;								// OSR of 500 &OK AMP
	SD24BPRE0 = CH0_DELAY;							// No Delay for Ch0 result

	SD24BINCTL1 = SD24INTDLY_0 + SD24GAIN_1;		// G=1 Int on 4th Samp
	SD24BCCTL1 = SD24SNGL + SD24DF_1 + SD24SCS__EXT1;    // External Trigger 1
	SD24BOSR1 = OSRCNT;								// OSR of 250 &OK AMP
	SD24BPRE1 = CH1_DELAY;							// Delay Ch 1 result by 10 cycles

	SD24BINCTL2 = SD24INTDLY_0 + SD24GAIN_1;		// G=1 Int on 4th Samp
	SD24BCCTL2 = SD24SNGL + SD24DF_1 + SD24SCS__EXT1;    // External Trigger 1
	SD24BOSR2 = OSRCNT;								// OSR of 250 &OK AMP
	SD24BPRE2 = CH2_DELAY;    						// Delay ch2 result by 20 Cycles

	SD24BINCTL3 = SD24INTDLY_0 + SD24GAIN_1;		// G=1 Int on 4th Samp
	SD24BCCTL3 = SD24SNGL + SD24DF_1 + SD24SCS__EXT1;    // External Trigger 1
	SD24BOSR3 = OSRCNT;                             // OSR of 250 &OK AMP
	SD24BPRE3 = CH3_DELAY;							// Delay Ch3 result by 30 Cycles

	SD24BIE = SD24IE3;								// Interrupt on EOC from Ch3
}//------------ End SDADC24 Initialisation ------------------------------------------------

Any Help would be highly appreciated! Thanks .

  • Hi,

    what I do not see in the code snippet is the global interrupt enable, hope you enabled it somewhere in main.

    Can you please check if the corresponding flags in the register SD24BIFG are set. This would help to judge if SD24 channels are converting at all.

  • Hi Aniruddha,

    if your problem is not resolved pls provide the requested information above? Otherwise it would be great if you can mark this as resolved.
    If there will be no response I will close this thread by end of the week.
  • Hello Dietmar,

    Greetings, and many apologies for the delayed response. I got hijacked into supporting some other burning issue in our department... so had to put this aside for a while.
    But to answer your question, Yes, I did include the global interrupt at the end of my initialization sequence in main(). It is the one of the last instructions executed before the code enters the infinite while loop.

    However, I have a new problem now.. after executing the global interrupt enable, it appears the watch dog timer is kicking in. There is only a lcd initialization function after the EINT. This is where the WDT kicks in. I am attaching my code below. I wonder why would the WDT kick in during the LCD initialization. Earlier the WDT never kicked in with the SD ADC module configured for continuous conversion. The only change I have made is to initialize the Timer 0 to trigger the SD ADC.
    I shall get back to you once I have resolved this issue of WDT resetting the controller.
    Kindly do bear with me... I really do appreciate your help and support.. Thank you !
    Best regards
    Aniruddha
  • Aniruddha,

    no problem regarding the WDT please check if the intervall you defined for WDT is long enough until you reset WDT so that it cannot be triggered.
    One pitfall is very of the oscillator fault flag reset loop which takes a bit long due to crystal start up. Things like this or long ISR for interrupts must be considered as well. So once you solved it we can make a new thread or reopen it so far I will close this.

**Attention** This is a public forum