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.

GPIOs GPA(B)MUX change time

Hi

I need to change the function of a Pin from PWM to GPIO and back to PWM.

How fast is this change?

How many NOPs should I implement until I could be sure the PWM output is activ? Or is there a better way?

Now I have something like this:

EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1;   // Configure GPIO0 as EPWM1A
EDIS;
 // give it some time to change the GPIO function,
 // but how much is enough
asm ("      NOP");
asm ("      NOP");
asm ("      NOP");
asm ("      NOP");
asm ("      NOP");
pwm_set_duty_cycle(pwm);

Thanks

René

  • Hi Rene,

    Rene Henke1 said:

    I need to change the function of a Pin from PWM to GPIO and back to PWM.

    How fast is this change?

    How many NOPs should I implement until I could be sure the PWM output is activ? Or is there a better way?

    Is there any particular reason why you're looking for such operation?


    Regards,

    Gautam

  • Hi Gautam

    I have to switch a current driver fully off and after a second switch it fully on again and after that continue pwm operation.
    If I change the pwm duty cycle my interrupt behavior would change too.
    If I can let the pwm counter run as it is my interrupts and system behavior will be the same like in pwm operation.

    Do you have any other suggestion to solve that?

    Regards
    René
  • Now I understand...
    I have to switch a current driver fully off and after a second switch it fully on again and after that continue pwm operation.

    So is this only at start or at regular intervals?

    If I change the pwm duty cycle my interrupt behavior would change too.

    What triggers your pwm interrupt here? ie configuration of ETSEL[INTSEL]

    Do you have any other suggestion to solve that?

    Here's an idea... what if you use a timer isr and control the duty of PWM there? (No need of GPIO then)

    Regards,
    Gautam