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.

C2000-F28004X-POWER-EST-CALC: Dimming a led with the help of a POT with ePWM

Part Number: C2000-F28004X-POWER-EST-CALC

Hello

I have a problem with this microcontroller, i could not make it change the light brightness of the microcontrollers led from port 31 and i am reading and re-reading the datasheet as much as i can. I found out that the led from the microcontroller doesnt support a pwm signal and that i should use another pin with a led for this project. Can someone tell me if they ever realized a dimming program with the microcontrollers led? Is it possible?

  • Hi Stan,

    Yes, GPIO34 and GPIO31 are not connected to an ePWM output on the F280049M ControlCard.  You can

    • Use the proto area on the baseboard to build an LED driver that is connected to an ePWM pin
    • Setup an ePWM module, and then instead of using the HW to toggle the IO at the right time, trigger an ISR and then go directly toggle GPIO31 or GPIO34 in the ISR code
      • The period of the PWM probably doesn't need to be very fast (~1kHz?) to control the apparent brightness, so this probably won't use that much CPU bandwidth.  
    • Setup an ePWM to generate a square wave on an unused GPIO.  Then use the INPUT X-BAR to route that signal back into the device, and then use the OUTPUT X-BAR to route the signal to OUTPUT X-BAR line 8, which can be mux'ed out on GPIO31.  
      • (The eCAP module is also connected to the output X-BAR and can be setup in PWM mode)