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);
}