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.

CCS/TMS320F28027: LAUNCHXL-F28027 Example epwm_updown_aq

Part Number: TMS320F28027
Other Parts Discussed in Thread: CONTROLSUITE, LAUNCHXL-F28027

Tool/software: Code Composer Studio

Hello 

I tried an example on my LAUNCHXL-F28027, the example is Example_2802xEPwmUpDownAQ located in C:\ti\controlSUITE\development_kits\C2000_LaunchPad\f2802x_examples\epwm_updown_aq.

I would like only to try the PWM on GPIO0 and GPIO1 but I see the LED on GPIO2 is also doing the PWM. I tried to comment these commands, but I still get PWM output on GPIO2 (can be see by the LED brightness).

    /*
    GPIO_setPullUp(myGpio, GPIO_Number_2, GPIO_PullUp_Disable);
    GPIO_setPullUp(myGpio, GPIO_Number_3, GPIO_PullUp_Disable);
    GPIO_setMode(myGpio, GPIO_Number_2, GPIO_2_Mode_EPWM2A);
    GPIO_setMode(myGpio, GPIO_Number_3, GPIO_3_Mode_EPWM2B);
    
    GPIO_setPullUp(myGpio, GPIO_Number_4, GPIO_PullUp_Disable);
    GPIO_setPullUp(myGpio, GPIO_Number_5, GPIO_PullUp_Disable);
    GPIO_setMode(myGpio, GPIO_Number_4, GPIO_4_Mode_EPWM3A);
    GPIO_setMode(myGpio, GPIO_Number_5, GPIO_5_Mode_EPWM3B);
	*/

    //PIE_registerPieIntHandler(myPie, PIE_GroupNumber_3, PIE_SubGroupNumber_2, (intVec_t)&epwm2_isr);
    //PIE_registerPieIntHandler(myPie, PIE_GroupNumber_3, PIE_SubGroupNumber_3, (intVec_t)&epwm3_isr);

    //InitEPwm2Example();
    //InitEPwm3Example();

    //PIE_enablePwmInt(myPie, PWM_Number_2);
    //PIE_enablePwmInt(myPie, PWM_Number_3);

/*
interrupt void epwm2_isr(void)
{

    // Update the CMPA and CMPB values
    update_compare(&epwm2_info);

    // Clear INT flag for this timer
    PWM_clearIntFlag(myPwm2);

    // Acknowledge this interrupt to receive more interrupts from group 3
    PIE_clearInt(myPie, PIE_GroupNumber_3);
}

interrupt void epwm3_isr(void)
{

    // Update the CMPA and CMPB values
    update_compare(&epwm3_info);

    // Clear INT flag for this timer
    PWM_clearIntFlag(myPwm3);

    // Acknowledge this interrupt to receive more interrupts from group 3
    PIE_clearInt(myPie, PIE_GroupNumber_3);
}
*/

How to disable GPIO2?

Victor

  • Sorry, it seems that the signal is coupled to GPIO2 so the LED is having the same PWM effect. So when I probed GPIO2 there is no more PWM effect only steady light (low signal).

    Edit to this:

        GPIO_setPullUp(myGpio, GPIO_Number_2, GPIO_PullUp_Enable);
        GPIO_setPullUp(myGpio, GPIO_Number_3, GPIO_PullUp_Enable);
        /*
        GPIO_setMode(myGpio, GPIO_Number_2, GPIO_2_Mode_EPWM2A);
        GPIO_setMode(myGpio, GPIO_Number_3, GPIO_3_Mode_EPWM2B);
        
        GPIO_setPullUp(myGpio, GPIO_Number_4, GPIO_PullUp_Disable);
        GPIO_setPullUp(myGpio, GPIO_Number_5, GPIO_PullUp_Disable);
        GPIO_setMode(myGpio, GPIO_Number_4, GPIO_4_Mode_EPWM3A);
        GPIO_setMode(myGpio, GPIO_Number_5, GPIO_5_Mode_EPWM3B);
    	*/

    Now it is ok. My bad.

  • Hi Victor,

    Glad to hear you solve the problem. Thank you for your question which might help other people in the future.

    Chen