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.

TMS320F28335: AD read value is always 0

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

Hi Team,

The customer uses the attached program, and the development board debugging can read the AD value normally, but the AD value of the board we set is always 0.

ADC program:

void DriverDspAdcInit(void)
{
EALLOW;
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; //使能ADC的时钟
ADC_cal(); //调用ADC_cal汇编语言,它是TI官方提供的。
EDIS;
AdcRegs.ADCREFSEL.bit.REF_SEL = 0x0; // 选择内部参考电压
AdcRegs.ADCTRL3.all = 0x00E0; // Power up bandgap/reference/ADC circuits

DELAY_US(50000L); // Delay before converting ADC channels
// AdcRegs.ADCTRL3.bit.SMODE_SEL=0;//
AdcRegs.ADCTRL3.bit.SMODE_SEL=1;// 1 同步采样模式
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; // 0x0 Dual Sequencer Mode, 0x1 Cascaded Mode
AdcRegs.ADCTRL3.bit.ADCCLKPS = 0x04; // Fclk = HSPCLK/2 = 37.5MHz
AdcRegs.ADCTRL1.bit.CPS = 1; // ADCCLK = Fclk/2 = 18.75MHz
AdcRegs.ADCTRL1.bit.CONT_RUN=0;//0 非连续

AdcRegs.ADCTRL1.bit.ACQ_PS = 0x01; // 设置启动脉冲的宽度
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 0x0; // 使能INT_SEQ1中断
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 0x1; // Reset SEQ/SEQ1
AdcRegs.ADCTRL2.bit.RST_SEQ2 = 0x1; // Reset SEQ/SEQ2
AdcRegs.ADCTRL2.bit.EPWM_SOCA_SEQ1=0x1; // 允许SEQ/SEQ1被EPWMA_SOCA信号触发启动

// AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 6; // Dummy meas. avoid 1st sample issue Rev0 Picollo*/
// AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 1; // A1-> Phase A Current
// AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 2; // B1-> Phase B Current
// AdcRegs.ADCCHSELSEQ1.bit.CONV03 = 3; // A3-> Phase C Current
// AdcRegs.ADCCHSELSEQ2.bit.CONV04 = 4; // B7-> Phase A Voltage TEMP
// AdcRegs.ADCCHSELSEQ2.bit.CONV05 = 5; // B6-> Phase B Voltage TEMP MOTOR
// AdcRegs.ADCCHSELSEQ2.bit.CONV06 = 12; // B4-> Phase C Voltage
// AdcRegs.ADCCHSELSEQ2.bit.CONV07 = 6; // A7-> DC Bus Voltage

AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0; // Dummy meas. avoid 1st sample issue Rev0 Picollo*/
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 1; // A1-> Phase A Current
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 2; // B1-> Phase B Current
AdcRegs.ADCCHSELSEQ1.bit.CONV03 = 3; // A3-> Phase C Current
AdcRegs.ADCCHSELSEQ2.bit.CONV04 = 4; // B7-> Phase A Voltage TEMP
AdcRegs.ADCCHSELSEQ2.bit.CONV05 = 5; // B6-> Phase B Voltage TEMP MOTOR
AdcRegs.ADCCHSELSEQ2.bit.CONV06 = 6; // B4-> Phase C Voltage
AdcRegs.ADCCHSELSEQ2.bit.CONV07 = 7;

AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 7;

EDIS;

/* Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 */
EPwm1Regs.ETSEL.bit.SOCAEN = 1; // 使能ADC启动脉冲ePWMxSOCA
EPwm1Regs.ETSEL.bit.SOCASEL = ET_CTR_PRD; // TBCTR = PEROID 时产生SOCA中断,因为IR2136反向的。
EPwm1Regs.ETPS.bit.SOCAPRD = ET_1ST; // 每发生一次事件,产生信号EPWM1SOCA
EPwm1Regs.ETCLR.bit.SOCA = 1; // Clear SOCA flag */
}

Hardware design: 5KW_Invertion.pdf

Could you help check this case?

Thanks & Regards,

Ben

  • Hello Ben,

    I'm a little confused by the way the post is worded, is the customer able to read a voltage applied to the input or is it always reading 0? Has the customer debugged by running one of the example projects from C2000Ware to verify they can read a known voltage from the device? (C2000Ware_4_XX_XX_XX\device_support\f2833x\examples\adc_soc)

    If they are getting any results on the ADC besides 0, can you please attach them here?

    Best regards,

    Omer Amir

  • Hi Omer,

    I am using TI routine (C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_examples_ccsv5\adc_soc), test result is still 0.

    Conversion count is changing  , we tested development board using same routine and it and get results.

    Best Regards,

    Ben

  • Hello Ben,

    Can you show me how the voltage reference for the ADC is configured and what the input signal to the ADC looks like (i.e. is it DC, AC, what voltage/frequency is it at, etc.)?

    Best regards,

    Omer Amir

  • Hi Omer,

    The problem have to do with 1.9V power circuit, and they used a jumper and problem resolved. Thanks for your help.

    Best Regards,

    Ben