Part Number: TMS320F28069
Dear Champs,
I am asking this for our customer.
The user is debugging codes and found something weird.
In their code, they have statements like below.
EPwm5Regs.TBPRD = wTzRefPeriod;
EPwm5Regs.CMPA.half.CMPA = 0;
EPwm5Regs.TBPHS.all = 0;
EPwm5Regs.TBCTR = 0;
EPwm5Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm5Regs.TBCTL.bit.CLKDIV = EPWM5_CLKDIV;
EPwm5Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;
EPwm5Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm5Regs.TBCTL.bit.PHSEN = TB_DISABLE;
EPwm5Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm5Regs.AQCTLA.bit.ZRO = AQ_SET;
EPwm5Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm5Regs.AQCSFRC.bit.CSFA = 0;
EPwm5Regs.DBCTL.bit.OUT_MODE = DB_DISABLE
Note that
They found ADC B0 to B3 would get large error in reading if "EPwm5Regs.AQCSFRC.bit.CSFA = 0;" was there. But if they commented this line "EPwm5Regs.AQCSFRC.bit.CSFA = 0;", then the ADC B0 to B3 reading became correct.
Note that even they disabled PWM5 by disabling its clock "SysCtrlRegs.PCLKCR1.bit.EPWM5ENCLK = 0", the issue was still there.
Also note that this only happened when the load was very high. That is, with light load, they did not observe this issue.
We believe this is related to noise, but we could not explain why this noise is related to this line "EPwm5Regs.AQCSFRC.bit.CSFA = 0;"
Questions:
Do you have any comment or suggestion for us to debug this issue?
Does this PWM setting have anything to do with ADC reading? Like internal connection?
Wayne Huang