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.

Configuring PWM Channels



Hello,

I've been stuck for a while on this, hopefully, simple problem with no forward progress. I am working with PWM channels. I use 8 channels; they are all independent, each with their own fault pin to indicate a overcurrent. With the scope of this project, I am using PWM0: GEN0, GEN1, GEN2, and GEN3 and PWM1: GEN0, GEN1, GEN2, and GEN3. I can get all channels on PWM0 to function flawlessly. PWM1, though setup identical to PWM0, was not turning on any channels for a while. I have narrowed the problem down to PWM1: GEN0 and the "ROM_PWMPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_7);" line of code.

The following is my configuration of the PWM1:GEN0 PWM parameters. The "ROM_PWMPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_7);" line in this code is what I comment out in order to allow channels on PWM1 to function. However, I need this line of code when I start doing fault handling, so I cannot just delete it. Does anyone have a suggestion as to why I would be experiencing the issues I have been seeing?

ROM_GPIOPinConfigure(GPIO_PQ0_M1PWM0);
ROM_GPIOPinTypePWM(GPIO_PORTQ_BASE, GPIO_PIN_0);
ROM_GPIOPinConfigure(GPIO_PF7_M1FAULT0);
ROM_GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_7);
ROM_PWMGenConfigure(PWM1_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC | PWM_GEN_MODE_FAULT_EXT |
                                           PWM_GEN_MODE_FAULT_LATCHED | PWM_GEN_MODE_FAULT_NO_MINPER | PWM_GEN_MODE_DBG_STOP);
ROM_PWMGenEnable(PWM1_BASE, PWM_GEN_0);

  • Have you held that, "GPIO_PF7_M1FAULT0" pin at its proper logic level? (not allowing it to float!)    Does it not appear that this pin is "faulting" thus disabling your desired PWM Outputs - which is its, "raison d'être."
     
    Have you properly initialized Port_F?

    We use PF0 as our (common) fault detect input pin for three PWM Generators (BLDC Motor) - under MINPER control - and its operation is most excellent!   Note that PF0 is 2 pins removed from our MCU's Analog Comparator Output (to which it is tied) - and which triggers upon an over-current condition - extinguishing ALL PWM outputs (only) during that fault's unique PWM cycle.  (thus enabling the "holy grail" of "Cycle by Cycle" current limiting!)