I am investigating ADC using TMS320F28388D.
The time to write the result register after AD conversion returns the same time for both 12bit and 16bit.
Time from trigger to interrupt flag check
12bit = 1.8us
16bit = 1.8us
After the ADC is completed, processing proceeds based on the data written to the result register.
The interrupt is set to occur at the timing when the result register is written. (INTPULSEPOS = 1)
The interrupt is not processed, but only the interrupt flag is used to make a decision.
There should be a change in the conversion time with the 12-bit/16-bit settings, but the interrupt timing does not change.
Is there something I am missing in the settings?
==================================================================
(Setting)
EALLOW;
// write configurations
AdcaRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to / 4
ADC_setMode(ADCA_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); // !!!!!!!! or 16bit
EDIS;
uint16_t acqps_A;
if ( 0 == AdcaRegs.ADCCTL2.bit.RESOLUTION ) { // 0 = 12bit, 1 = 16bit
acqps_A = 19; // margin(5) + 14 = (-1) + 15 = sysclk / 75ns(DataSheet)
}
else { //resolution is 16-bit
acqps_A = 68; // margin(5) + 63 = (-1) + 64 = sysclk / 320ns(DataSheet)
}
EALLOW;
// ADC-A
AdcaRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x2;
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 2;
AdcaRegs.ADCSOC0CTL.bit.ACQPS = acqps_A;
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 0x5;
AdcaRegs.ADCINTSEL1N2.bit.INT1E = 1;
AdcaRegs.ADCINTSEL1N2.bit.INT1SEL = 0;
AdcaRegs.ADCINTSEL1N2.bit.INT1CONT = 1;
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
AdcaRegs.ADCSOC1CTL.bit.CHSEL = 3;
AdcaRegs.ADCSOC1CTL.bit.ACQPS = acqps_A;
AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 0x5;
AdcaRegs.ADCINTSEL1N2.bit.INT2E = 1;
AdcaRegs.ADCINTSEL1N2.bit.INT2SEL = 1;
AdcaRegs.ADCINTSEL1N2.bit.INT2CONT = 1;
AdcaRegs.ADCINTFLGCLR.bit.ADCINT2 = 1;
AdcaRegs.ADCSOC2CTL.bit.CHSEL = 4;
AdcaRegs.ADCSOC2CTL.bit.ACQPS = acqps_A;
AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = 0x5;
AdcaRegs.ADCSOC3CTL.bit.CHSEL = 5;
AdcaRegs.ADCSOC3CTL.bit.ACQPS = acqps_A;
AdcaRegs.ADCSOC3CTL.bit.TRIGSEL = 0x5;
// Set pulse positions to late
AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1; // Interrupt Pulse Generate Timing. Conversion End Timing.
// power up the ADCs
AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1;
EDIS;
DEVICE_DELAY_US(1000);
=================================================================
(process)
!! TRIGGER !!
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
AdcaRegs.ADCINTFLGCLR.bit.ADCINT2 = 1;
Timer Start
while (1) { if ( AdcaRegs.ADCINTFLG.bit.ADCINT2 == 1 ) break; }
Timer End
=================================================================