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: PWM Software Control LEDs

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

I try to dim the user LEDs on the board TMS570LC43x. I wrote this code down but still can't get the result. Can somebody help me? 

What is a good value for the tick or duty?

void pwm_software(unsigned int tick,unsigned int duty){

    tick++;
    if (tick > 10000)
    {
        tick=0;
    }

    if (tick < duty )
    {
        gioSetBit(gioPORTB,6,1);
    }
    else
    {
        gioSetBit(gioPORTB,6,0);
    }
 }

void main(void){
    while(1){

            UInt32 tick = rtiGetCurrentTick(rtiREG1,rtiCOMPARE0);
            pwm_software(tick,10);
        }