I use the TMS320F28035 card and controlSUITE code to control a motor. During the control process, I have the AD converter to convert some analog signal to digital signal. Now I have a problem. That is in the debug mode, the whole system works good and AD results are good all the time, but in the stand alone mode, the system still works but the AD results have huge variation. In both modes, they convert the same signal. I thought it's due to the calibration. But actually in my code, it has the AD calibration code during system initialization as below:
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; // Enable ADC peripheral clock
(*Device_cal)(); // Auto-calibrate from TI OTP
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 0; // Return ADC clock to original state
I measured the analog signal in both mode by using the oscilloscope, they are the same.
Is there anyone who has any suggestion about this?