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 .