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.

[参考译文] TMS320F280025C:F280025和 F280049芯片 PWM 之间的配置差异

Guru**** 2457760 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1036689/tms320f280025c-configuration-difference-between-f280025-and-f280049-chip-pwm

器件型号:TMS320F280025C

尊敬的团队:

除了 EPWMSYNCINSEL  EPWMSYNCOUTEN 的两个寄存器外、两个芯片之间的 PWM 配置是否有差异

我的客户将 F280049代码应用到 F280025、发现芯片可以正常工作。 但 F280025的 ePWM 没有输出信号、载波信号和比较器的输入信号都没有、但没有输出。

GpioCtrlRegs.GPAPUD.bit.GPIO0 = 1;
GpioCtrlRegs.GPAGMUX1.bit.GPIO0 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1;

EPwm1Regs.TBPRD = C_INIT_PRD;
EPwm1Regs.CMPB.bit.CMPB = EPwm1Regs.TBPRD - gADC.DelayApply;
EPwm1Regs.TBPHS.all = 0;
EPwm1Regs.TBCTL.all = 0xE012;

EPwm1Regs.TBCTL.bit.HSPCLKDIV = PWM_CLK_DIV;
EPwm1Regs.TBCTL.bit.PHSDIR = TB_UP;

EPwm1Regs.CMPCTL.all = 0x0100;

EPwm1Regs.CMPA.bit.CMPA = C_INIT_PRD/2;

EPwm1Regs.AQCTLA.all = 0x0060;

EPwm1Regs.AQSFRC.all = 0x0;
EPwm1Regs.AQCSFRC.all = 0x0;
EPwm1Regs.DBCTL.all = 0x000B;

EPwm1Regs.DBFED.bit.DBFED = C_MAX_DB;
EPwm1Regs.DBRED.bit.DBRED = C_MAX_DB;

EPwm1Regs.EPWMSYNCINSEL.bit.SEL = 0x01;
EPwm1Regs.EPWMSYNCOUTEN.bit.ZEROEN = 1;

EPwm1Regs.TZDCSEL.all = 0x0C3;

EPwm1Regs.DCTRIPSEL.bit.DCALCOMPSEL =3;
EPwm1Regs.DCTRIPSEL.bit.DCBLCOMPSEL =4;

EPwm1Regs.DCALTRIPSEL.bit.TRIPINPUT4 =1;//trip4
EPwm1Regs.DCBLTRIPSEL.bit.TRIPINPUT5 =1;//trip5

EPwm1Regs.DCACTL.all = 0x0002;
EPwm1Regs.DCBCTL.all = 0x0002;

//Set the Trip-zone (TZ) Module
EPwm1Regs.TZCLR.all = 0x02F;

EPwm1Regs.TZSEL.bit.OSHT1 = 1; // OSHT1:TZ1;
//内部比较器1 2作为触发EPWMXA的逐波限流(ost)触发源
EPwm1Regs.TZSEL.bit.DCAEVT1 = 1;//Enable DCAEVT1 as a ost trip source for this ePWM module
EPwm1Regs.TZSEL.bit.DCBEVT1 = 1;//Enable DCBEVT1 as a ost trip source for this ePWM module

EPwm1Regs.TZCTL.bit.TZA = 2;//Force EPWMxA to a low state
EPwm1Regs.TZCTL.bit.TZB = 2;//Force EPWMxA to a low state
EPwm1Regs.TZCTL.bit.DCAEVT1 = 2;//Force EPWMxA to a low state
EPwm1Regs.TZCTL.bit.DCBEVT1 = 2;//Force EPWMxA to a low state

EPwm1Regs.TZEINT.bit.OST = 1;
EPwm1Regs.TZEINT.bit.DCAEVT1 = 1;
EPwm1Regs.TZEINT.bit.DCBEVT1 = 1;

//Set the Event-trigger (ET) Module
EPwm1Regs.ETCLR.bit.INT = 1;
EPwm1Regs.ETSEL.all = 0x0F09;

EPwm1Regs.ETPS.all = 0x0101;

此致

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    绿色环保、

    如果在迁移代码时考虑了 EPWM 寄存器差异、您能否查看表3上的 F28004x<>F28002x 迁移文档(SPRACK2)?

    谢谢、

    Joseph