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.

[参考译文] CC2340R5:将 PWM 设置为 CC2340 EVM 的 DIO8

Guru**** 2589280 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1380497/cc2340r5-set-pwm-to-dio8-of-cc2340-evm

器件型号:CC2340R5

工具与软件:

大家好、团队成员:

我们使用的是示例代码:pwmled1并将 DIO8重映射为 PWM 输出、但 DIO8无法测量任何 PWM 信号。

(SDK:simplelink_lowpower_f3_sdk_8_10_01_02)

但是、我们可以将 PWM 设置为 DIO14。

请帮助提供意见。

谢谢。

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

    尊敬的 Mike:

    1. LGPT1会初始化为16位计数器(PWMTimerLPF3_getMaxCount -> LGPTimerLPF3_getCounterWidth Max 0xFFFE)、因此 PWMTimerLPF3_getPeriodCounts 将在使用 PWM_PERIOD_US 的 dutyUnits 时返回的周期计数大于最大 值并且 pwmPeriod (0x1350_100uT)(使用公式时返回的周期计数大于~(0x100 μ s);如果使用 periodFlash (1)、则 PWM_Period (0x100 (1)。  因此 pwmPeriod 应该减少到1300或者更少。  否则、您会注意到代码被 while 循环捕获、因为 PWM_open 返回 NULL。
    2. PWMTimerLPF3.c 只考虑 channelConfig[x].pin 值、而不考虑 nPin、因此互补通道是默认 PWM TI 驱动器的问题。  您必须修改 PWMTimerLPF3.c 并将这个副本直接放置到您的项目工作区中、或者通过添加 LGPT1 Channel 0连接来解决该问题。

    之后、您应该能够看到 DIO8 PWM 引脚按预期运行

    此致、
    Ryan