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.

[参考译文] RM57L843:N2HET 计时器- PWM 输入捕捉

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1256932/rm57l843-n2het-timer---pwm-input-capture

器件型号:RM57L843
主题中讨论的其他器件:HALCOGEN

您好、TI 团队、

我想在 n2het 模块中捕获具有占空比和周期的输入 PWM。 我已按如下所示使用 halcogen 配置该程序、

我已经使用 NEHET1[9]引脚来获得输入 PWM。 我将使用第0沿和下降沿中断。 我的主程序如下所示、

#include "HL_HET.h"
#include "HL_Gio.h"
#include "HL_sys_common.h"

hetSIGNAL_t get_pwm={0};

int main (空)
{
_enable_irq();
hetInit ();
edgeEnableNotification (hetREG1、edge0);

while (1);
返回0;

void edgeNotification (hetbas_t * hetREG、uint32边沿)
{
capGetSignal (hetRAM1、cap0、&GET_PWM);

调试后、我得到占空比为0XFFFFFFFF、时间周期为0。我在这里犯了什么错误。 我给 n2het1[9]的输入一个超声波传感器输出。 当超声波传感器检测到的距离为 PWM 时、占空比宽度将发生相应变化、为此、我需要捕获输入 PWM。

请支持我、

提前感谢、

此致、

A. Ajith Kumar