infineon4engi@twitter infineon@linkedin infineon4engineers infineon@youtube
twitter Facebook Linkedin Youtube

+ Reply to Thread
Results 1 to 10 of 10

Thread: PWMSP002 : Output pins do not return to passive level when the App is stopped

  1. #1
    Aaron Walsh
    Guest

    PWMSP002 : Output pins do not return to passive level when the App is stopped

    Before starting the PWMSP002 App with API call 'PWMSP002_Start', the direct and inverted output pins sit in the 'Passive Level state (in my case low).

    When I stop the PWMSP002 App with API call 'PWMSP002_Stop' the direct and inverted output pins remain in their last known state which I believe is dependent on the timer value and compare register. In my case the outputs remain high which is not desirable.

    Is there a method for stopping the PWM and ensuring the outputs return to their 'Passive level' states ?

    I am considering making and breaking the signal connections in code instead of fixing them using the App configuration tab so I can reset the output pins directly from code once I have stopped the Apps but I would rather use API calls if possible.

    Any help would be greatly appreciated.

    Best regards
    Aaron

  2. #2
    Aaron Walsh
    Guest
    I have found that the 'PWMSP002_Stop()' function resets the PWM timer to zero. This has the effect of leaving the output pin in the Non passive level if the passive state is configured to occur 'After Compare match' (assuming the compare register is greater than zero which is the case for anything but 0% DutyCycle).

    My feeling is the 'PWMSP002_Stop()' function should not reset the PWM timer to zero as this can be done with the 'PWMSP002_SetTimerVal() function before starting the timer with the 'PWMSP002_Start()' function.

    If anyone knows of a workaround I would really appreciate it.

    Best regards
    Aaron

  3. #3
    sam^_^
    Guest
    Hi Aaron, I'm concerned with this kind of problem too. I use CCUST01_Start() and CCUST01_Stop() to start and stop synchronously 4 pwm, but some outputs stay in the active level after being stopped, and that's not nice!...I started last week with Infineon XMC4500, so I'm completely new to this kind of processor...I'm waiting for some suggestion, since my FAE is on holiday!...
    I agree with you, the stop function resets the timer to zero, so we do not have control on the outputs levels, but a way must exist to force the outputs low. With Texas DSPs I stop the pwm by putting them in high impedence state, like a sw-forced trap feature, is there something similar with XMC4000?
    I hope some suggestions come soon :-)

    samuele

  4. #4
    Aaron Walsh
    Guest
    Hi Samuele,

    After 2 days of trying all possible combinations of API function calls I believe I have found a workaround using the GPIO_144.h macros to configure and control I/O pins. You will find GPIO_144.h in some DAVE examples.
    • My PWMSP002 'direct output' signal is configured to be connected to pin P0.6 from the 'Signal Connection' dialog.
    • At the point I want the output pin to be left in a particular state, I re-configure the I/O pin to be a general purpose output pin and set it's output state using a GPIO_144.h macro call.
    • Then I stop the PWMSP002 app
    • Immediately after re-starting the PWMSP002 app I re-configure the pin to be connected to the PWMSP002 direct output signal again
    Have a look at table 25.10.1 in the xmc4500_rm_v1+2_2012_12_.pdf manual. You will see pin P0.6 has an alternative (ALT3) function which allows it to be connected to CCU8 OUT30 (which is what PWMSP002 uses as it's direct output).

    I have partially tested this workaround and it is looking good so far. Here is my code...

    Stopping PWM

    Code:
        // Set output pin low and disconnect from PWMSP002 app.
        // This is essential as stopping PWM apps leaves pins in undefined state, typically high
        P0_6_reset();
    
    
        // Disconnect output pin from PWMSP002 app
        P0_6_set_mode(OUTPUT_PP_GP);
    
    
        // Stop PWM
        PWMSP002_Stop(&PWMSP002_Handle3);
    Starting PWM


    Code:
        // Start PWM
        PWMSP002_Start(&PWMSP002_Handle3);
    
    
        // Connect output pin to PWMSP002 app
        P0_6_set_mode(OUTPUT_PP_AF3);    // Alternative function 3 (ALT3) configuration
    I hope this helps
    Best regards
    Aaron

  5. #5
    Aaron Walsh
    Guest
    Hi Samuele,

    I have carried out further tests. The workaround works well. I would however like to see a solution within the APP's.

    Best regards
    Aaron

  6. #6
    sam^_^
    Guest
    thanks Aaron,
    I've never considered doing like this, but I think I'll try as you suggest. Anyway, I cannot find GPIO_144.h in the projects, can you tell me where it is located?
    thank U
    samuele

  7. #7
    Aaron Walsh
    Guest
    Hi Samuele,

    File attached for the xmc4500. I am using the 100 pin device but I use the 144 pin header file so I can also run my code on the Infineon hexagon kit which has a 144 pin device.

    GPIO_144pin.zip

    Best regards
    Aaron

  8. #8
    sam^_^
    Guest
    thanks again Aaron, this afternoon I'm going to try...

    Should I find other solutions I'll share them in the forum :-)

    samuele

  9. #9
    sam^_^
    Guest
    it works good :-)
    thank you!
    samuele

  10. #10
    New Member New Member yhaksoz is on a distinguished road
    Join Date
    Nov 2019
    Location
    USA
    Posts
    6
    Points
    120
    I am new to XMC and DAVE. I came across to this problem when working on some examples.
    I would like to know if there is a solution to this problem within the app now. Or, is the method offered here still the only solution after 7 years?
    Thank you.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.