Part Number: TMS320F280049C Hey - I am developing with the F280049C Launchpad. I have a question on why a delay is required when simultaneously sampling multiple channels. This appears to be only required when using software to force an SOC. In my code, I have setup to sample 3 analog inputs on SOC0 (ADCAIN14, ADCBIN7, and ADCCIN7), 3 analog inputs on SOC1 (ADCAIN5, ADCBIN0, and ADCCIN2), and 1 analog input on SOC2 (ADCBIN1). I setup SOC2 to set ADCINT1 on completion. I set each Force Start of Conversion Bit and then wait for the ADCINT1 flag. The problem I ran into is if I don't delay ~2000us between setting the Force bit and reading the ADCINT1 bit I get erratic results. I noticed in C2000Ware MotorControl SDK the runADCZeroOffsetCalibration() routine does the same (inserts the 2000us delay). Why is the delay necessary? And is this required if the trigger is not from software? My code for the loop is as follows: while (cnt < 512) { AdcaRegs.ADCSOCFRC1.all = 0x3; // Force SOC0 and SOC1 on ADCA AdcbRegs.ADCSOCFRC1.all = 0x7; // Force SOC0, SOC1, and SOC2 on ADCB AdccRegs.ADCSOCFRC1.all = 0x3; // Force SOC0 and SOC1 on ADCC DELAY_US(2000); while (AdcbRegs.ADCINTFLG.bit.ADCINT1 != 1) { } DELAY_US(200); IsenA += AdcaResultRegs.ADCRESULT0; IsenB += AdccResultRegs.ADCRESULT0; IsenC += AdcbResultRegs.ADCRESULT0; VsenA += AdcaResultRegs.ADCRESULT1; VsenB += AdcbResultRegs.ADCRESULT1; VsenC += AdccResultRegs.ADCRESULT1; VsenPVDD += AdcbResultRegs.ADCRESULT2; cnt += 1; AdcbRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; } Thanks! Brett
↧