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:Code Composer Studio™︎论坛

Guru**** 2387830 points
Other Parts Discussed in Thread: HALCOGEN, RM48L950
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/890768/ccs-code-composer-studio-forum

主题中讨论的其他器件:HALCOGENRM48L950

工具/软件:Code Composer Studio

您好,

我使用的是 RM48L950。 我想用中断(100us)更改 PWM 占空比。 我正在这样做、但示波器中存在信号问题。我在 HALCoGen 中进行了每项设置。 下面是我得到的代码和误差。 信号中断。原因是什么 ?如何解决此问题? 如果你能帮助我,我将不胜感激,如果你能很快回来,我将非常高兴。

祝你度过美好的一天!

代码-


#include "sys_common.h"

#include "rti.h"
#include "het.h"
#include "Gio.h"
int i;

void main (void)

sciInit();
hetInit();
rtiInit();

gioSetDirection (hetPORT1、0xFFFFFFFF);
pwmStart (hetRAM1、pwm0);

rtiEnableNotification (rtiNOTIFICATION_COMPARE0);


_enable_IRQ ();


rtiStartCounter (rtiCOUNTER_BLOCK0);

while (1);


void rtiNotification (uint32通知)

如果(I < 101)

i++;

其他

I=0;

pwmSetDuty (hetRAM1、pwm0、I);

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

    您好!

    这是 HalCoGen 中包含的 NHET PWM 代码中的一个已知错误

    权变措施是不要直接将占空比从100%更改为0%、并首先使用中间值、然后使用0%。

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

    感谢您的回答。 我尝试将占空比%70更改为%50 (它位于下面)。 它正在工作,但我必须在%0-%100之间更改。 我该如何做。我需要做什么更改以及如何做? 我想我必须更改 HALCoGen 代码。 您能否 提供有关此方面的更多信息? 我也有一个问题、那就是 HALCoGen 中的"U"是什么? 定义位置?

    感谢你的帮助。

    祝你度过美好的一天!

    代码-


    #include "sys_common.h"

    #include "rti.h"
    #include "het.h"
    #include "Gio.h"
    int i;
    bool j=0;


    void main (void)


    hetInit();
    rtiInit();

    gioSetDirection (hetPORT1、0xFFFFFFFF);
    pwmStart (hetRAM1、pwm0);

    rtiEnableNotification (rtiNOTIFICATION_COMPARE0);


    _enable_IRQ ();


    rtiStartCounter (rtiCOUNTER_BLOCK0);

    while (1);


    void rtiNotification (uint32通知)


    如果(j=0)

    如果(I < 70)

    i++;
    如果(i =70)

    J=1;



    如果(j==1)

    如果(I > 50)

    一----;
    如果(i == 50)

    J=0;



    pwmSetDuty (hetRAM1、pwm0、I);

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

    您好!

    请参阅此帖子、了解0%至100%占空比。

    https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/516382/1875161?tisearch=e2e-sitesearch&keymatch=100%25%20duty%20cycle#1875161

    数字后缀"U"或"u"(例如0xFFC00008U)表示"unsigned int"。 一些编译器假设任何不带'u'等后缀的数字都是 int 类型。

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

    感谢您的帮助、

    干得不错。