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.

TMS320F28379S: ADC Conversion timing

Part Number: TMS320F28379S

Hi all,

I'm using the controller TMS320F28379S for my application I'm using all the 20 Analog inputs, I need to know, how much does the ADC required to given me the result (ADC Conversion time) ?

ADC is triggered using the Timer0, Below is my ADC code section

// ADC Configuration


EALLOW;

AdcaRegs.ADCCTL2.bit.PRESCALE = ADC_CLK_PRESCALAR; // Set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // ADCA , 12 Bit, Single Ended Mode
AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up the ADC

AdcbRegs.ADCCTL2.bit.PRESCALE = ADC_CLK_PRESCALAR; // Set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // ADCA , 12 Bit, Single Ended Mode
AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up the ADC

AdccRegs.ADCCTL2.bit.PRESCALE = ADC_CLK_PRESCALAR; // Set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // ADCA , 12 Bit, Single Ended Mode
AdccRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up the ADC

AdcdRegs.ADCCTL2.bit.PRESCALE = ADC_CLK_PRESCALAR; // Set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); // ADCA , 12 Bit, Single Ended Mode
AdcdRegs.ADCCTL1.bit.ADCPWDNZ = 1; // Power up the ADC

// ADC Channel Selection
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0; //SOC0 will convert pin A0
AdcaRegs.ADCSOC1CTL.bit.CHSEL = 1; //SOC1 will convert pin A1
AdcaRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC2 will convert pin A2
AdcaRegs.ADCSOC3CTL.bit.CHSEL = 3; //SOC3 will convert pin A3
AdcaRegs.ADCSOC4CTL.bit.CHSEL = 4; //SOC4 will convert pin A4
AdcaRegs.ADCSOC5CTL.bit.CHSEL = 5; //SOC5 will convert pin A5
AdcbRegs.ADCSOC0CTL.bit.CHSEL = 0; //SOC0 will convert pin B0
AdcbRegs.ADCSOC1CTL.bit.CHSEL = 1; //SOC1 will convert pin B1
AdcbRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC2 will convert pin B2
AdcbRegs.ADCSOC3CTL.bit.CHSEL = 3; //SOC3 will convert pin B3
AdccRegs.ADCSOC0CTL.bit.CHSEL = 2; //SOC0 will convert pin C2
AdccRegs.ADCSOC1CTL.bit.CHSEL = 3; //SOC1 will convert pin C3
AdccRegs.ADCSOC2CTL.bit.CHSEL = 4; //SOC2 will convert pin C4
AdcdRegs.ADCSOC0CTL.bit.CHSEL = 0; //SOC0 will convert pin D0
AdcdRegs.ADCSOC1CTL.bit.CHSEL = 1; //SOC1 will convert pin D1
AdcdRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC2 will convert pin D2
AdcdRegs.ADCSOC3CTL.bit.CHSEL = 3; //SOC3 will convert pin D3
AdcdRegs.ADCSOC4CTL.bit.CHSEL = 4; //SOC4 will convert pin D4
AdcaRegs.ADCSOC14CTL.bit.CHSEL = 14; //SOC5 will convert pin A14
AdcaRegs.ADCSOC15CTL.bit.CHSEL = 15; //SOC5 will convert pin A15

AdcaRegs.ADCSOC0CTL.bit.ACQPS = 14; //SOC0 will convert pin A0 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC1CTL.bit.ACQPS = 14; //SOC1 will convert pin A1 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC2CTL.bit.ACQPS = 14; //SOC2 will convert pin A2 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC3CTL.bit.ACQPS = 14; //SOC3 will convert pin A3 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC4CTL.bit.ACQPS = 14; //SOC4 will convert pin A4 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC5CTL.bit.ACQPS = 14; //SOC5 will convert pin A5 - sample window is 100 SYSCLK cycles = 75nS
AdcbRegs.ADCSOC0CTL.bit.ACQPS = 14; //SOC0 will convert pin B0 - sample window is 100 SYSCLK cycles = 75nS
AdcbRegs.ADCSOC1CTL.bit.ACQPS = 14; //SOC1 will convert pin B1 - sample window is 100 SYSCLK cycles = 75nS
AdcbRegs.ADCSOC2CTL.bit.ACQPS = 14; //SOC2 will convert pin B2 - sample window is 100 SYSCLK cycles = 75nS
AdcbRegs.ADCSOC3CTL.bit.ACQPS = 14; //SOC3 will convert pin B3 - sample window is 100 SYSCLK cycles = 75nS
AdccRegs.ADCSOC0CTL.bit.ACQPS = 14; //SOC2 will convert pin C2 - sample window is 100 SYSCLK cycles = 75nS
AdccRegs.ADCSOC1CTL.bit.ACQPS = 14; //SOC3 will convert pin C3 - sample window is 100 SYSCLK cycles = 75nS
AdccRegs.ADCSOC2CTL.bit.ACQPS = 14; //SOC3 will convert pin C4 - sample window is 100 SYSCLK cycles = 75nS
AdcdRegs.ADCSOC0CTL.bit.ACQPS = 14; //SOC0 will convert pin D0 - sample window is 100 SYSCLK cycles = 75nS
AdcdRegs.ADCSOC1CTL.bit.ACQPS = 14; //SOC1 will convert pin D1 - sample window is 100 SYSCLK cycles = 75nS
AdcdRegs.ADCSOC2CTL.bit.ACQPS = 14; //SOC2 will convert pin D2 - sample window is 100 SYSCLK cycles = 75nS
AdcdRegs.ADCSOC3CTL.bit.ACQPS = 14; //SOC3 will convert pin D3 - sample window is 100 SYSCLK cycles = 75nS
AdcdRegs.ADCSOC4CTL.bit.ACQPS = 14; //SOC4 will convert pin D4 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC14CTL.bit.ACQPS = 14; //SOC4 will convert pin A4 - sample window is 100 SYSCLK cycles = 75nS
AdcaRegs.ADCSOC15CTL.bit.ACQPS = 14; //SOC5 will convert pin A5 - sample window is 100 SYSCLK cycles = 75nS

// ------------------------------------------------- ADC Triggering Source Selection ------------------------------------------------- //
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC3CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC4CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC5CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcbRegs.ADCSOC1CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcbRegs.ADCSOC2CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcbRegs.ADCSOC3CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdccRegs.ADCSOC0CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdccRegs.ADCSOC1CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdccRegs.ADCSOC2CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcdRegs.ADCSOC0CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcdRegs.ADCSOC1CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcdRegs.ADCSOC2CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcdRegs.ADCSOC3CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcdRegs.ADCSOC4CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC14CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n
AdcaRegs.ADCSOC15CTL.bit.TRIGSEL = 1; // Trigger by Timer 0 / TINT0n

AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 1; // End of SOC1 will set INT1 flag
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable INT1 flag
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Make sure INT1 flag is cleared

AdcbRegs.ADCINTSEL1N2.bit.INT1SEL = 1; // End of SOC1 will set INT1 flag
AdcbRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable INT1 flag
AdcbRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Make sure INT1 flag is cleared

AdccRegs.ADCINTSEL1N2.bit.INT1SEL = 1; // End of SOC1 will set INT1 flag
AdccRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable INT1 flag
AdccRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Make sure INT1 flag is cleared

AdcdRegs.ADCINTSEL1N2.bit.INT1SEL = 1; // End of SOC1 will set INT1 flag
AdcdRegs.ADCINTSEL1N2.bit.INT1E = 1; // Enable INT1 flag
AdcdRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Make sure INT1 flag is cleared

EDIS;

// Timer Interrupt : For Every 50µSec

AdccRegs.ADCSOCFRC1.all = 0x0007; //SOC0,1 and SOC2 // ADCSOC is done in the TMR0_ISR

Regards,

Rajamurugan

  • Hello Rajamurugan,

    You can refer to the ADC Timings section in the F2837xS reference manual to see how the conversion time is calculated. For 12-bit single-ended mode, refer to diagrams 10-13 and 10-14. The following table shows the values for the timing (the ACQPS has a minimum value of 15 SYSCLKs, but may need to be adjusted depending on capacitance and resistance of the input):