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.

f28377s LauchPad中将ePWM例程修改ePWM为6,7,8路,只有6有输出,这是怎么回事

把对应的epwm123改为epwm678结果只有6有输出,这是怎么回事啊

  • 你EPWM7 和EPWM8的GPIO MUX改了吗?时钟开了吗?

  • MUX的设置如下,这些都是默认的,我都没碰

    void InitEPwm6Gpio(void)
    {
    EALLOW;
    /* Disable internal pull-up for the selected output pins
    for reduced power consumption */
    // Pull-ups can be enabled or disabled by the user.
    // This will enable the pullups for the specified pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAPUD.bit.GPIO10 = 1; // Disable pull-up on GPIO10 (EPWM6A)
    GpioCtrlRegs.GPAPUD.bit.GPIO11 = 1; // Disable pull-up on GPIO11 (EPWM6B)
    // GpioCtrlRegs.GPEPUD.bit.GPIO155 = 1; // Disable pull-up on GPIO155 (EPWM6A)
    // GpioCtrlRegs.GPEPUD.bit.GPIO156 = 1; // Disable pull-up on GPIO156 (EPWM6B)

    /* Configure EPWM-6 pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be EPWM6 functional pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 1; // Configure GPIO10 as EPWM6A
    GpioCtrlRegs.GPAMUX1.bit.GPIO11 = 1; // Configure GPIO11 as EPWM6B
    // GpioCtrlRegs.GPEMUX2.bit.GPIO155 = 1; // Configure GPIO155 as EPWM6A
    // GpioCtrlRegs.GPEMUX2.bit.GPIO156 = 1; // Configure GPIO156 as EPWM6B

    EDIS;
    }

    void InitEPwm7Gpio(void)
    {
    EALLOW;
    /* Disable internal pull-up for the selected output pins
    for reduced power consumption */
    // Pull-ups can be enabled or disabled by the user.
    // This will enable the pullups for the specified pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAPUD.bit.GPIO12 = 1; // Disable pull-up on GPIO12 (EPWM7A)
    GpioCtrlRegs.GPAPUD.bit.GPIO13 = 1; // Disable pull-up on GPIO13 (EPWM7B)
    // GpioCtrlRegs.GPEPUD.bit.GPIO157 = 1; // Disable pull-up on GPIO157 (EPWM7A)
    // GpioCtrlRegs.GPEPUD.bit.GPIO158 = 1; // Disable pull-up on GPIO158 (EPWM7B)

    /* Configure EPWM-6 pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be EPWM6 functional pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 1; // Configure GPIO12 as EPWM7A
    GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 1; // Configure GPIO13 as EPWM7B
    // GpioCtrlRegs.GPEMUX2.bit.GPIO157 = 1; // Configure GPIO157 as EPWM7A
    // GpioCtrlRegs.GPEMUX2.bit.GPIO158 = 1; // Configure GPIO158 as EPWM7B

    EDIS;
    }

    时钟如下:

    // enable PWM1, PWM2 and PWM3
    CpuSysRegs.PCLKCR2.bit.EPWM6=1;
    CpuSysRegs.PCLKCR2.bit.EPWM7=1;
    CpuSysRegs.PCLKCR2.bit.EPWM8=1;

    您帮我看看这个怎么弄啊

  • 你是测试的哪个例程?

  • epwm_updown_aq

  • 这个板子上不是没有ePWM2吗,我就想用一下epwm678,但是改了之后就只有6有输出了

  • 你是用的GPIO12 13 14 15测得吗?

  • 是的,现在已经有波形了

  • Launchpad上的PWM7 和PWM8都是可以输出PWM的。你把PWM的初始化代码贴出来看看

x 出现错误。请重试或与管理员联系。