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/TMS570LC4357: Generating PWM on User Led with Software Control

Part Number: TMS570LC4357
Other Parts Discussed in Thread: LAUNCHXL2-570LC43

Tool/software: Code Composer Studio

Hello,

how can i generate a pwm on my user leds, to let them dim ?

I know that epwm modules are not connected to the LEDs. So i need a software control. Can someone help me?

Thanks

  • Hello user,

    Assuming you are using the LAUNCHXL2-570LC43 launchpad, you can review the schematic to see which signals are connected to the user LEDs at this link: processors.wiki.ti.com/.../LAUNCHXL2-570LC43

    From my review and assuming you are meaning LED2 and LED3 on the Launchpad, these are shown to be connected to GIOB[6] and GIOB[7]. Although there are also some muxed fucntions these pins are also capable of such as nERROR1, EMIF_WAIT, etc. these other muxed function are not going to be much help. For this reason, if you want to have a PWM output to the USER LED's you will need to use only the GIO signals toggling as your PWM output. There are multiple ways you could achieve this. The simplist is to have only a while loop toggling the pin signal with a delay between toggles. If there is a need to vary the PWM signal frequency or duty cycle, you could make the delay a variable dependent on a received value over SPI, SCI or based on some other input method. For duty cycle changes, you would need to have two separate timers, one for on and one for off so that you could change the delay values proportionately to achieve the desired duty cycle.

    Another method would be to use the RTI together with an RTI interrupt to control the delays. This is slightly more complex but it is also more deterministic if to be used as part of a bigger project with more features.