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 软件控制 LED

Guru**** 2472960 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/679236/ccs-tms570lc4357-pwm-software-control-leds

器件型号:TMS570LC4357

工具/软件:Code Composer Studio

我尝试调暗板 TMS570LC43x 上的用户 LED。 我记下了该代码、但仍然无法获得结果。 有人可以帮帮我吗?  

什么是良好的节拍或占空比值?

void PWM_software (unsigned int tick、unsigned int Duty){

tick++;
如果(勾选> 10000)
{
节拍=0;
}

如果(勾号< duty)
{
gioSetBit (gioPORTB、6、1);
}
其他
{
gioSetBit (gioPORTB、6、0);
}
}

void main (void){
while (1){

uint32 tick = rtiGetCurrentTick (rtiREG1、rtiCOMPARE0);
PWM_SOFTWARE (tick、10);
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您可以尝试使用此函数更新 PWM 的占空比。

    etpwmSetCmpA (etpwmREG6、更新);