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: Set PWM to DIO8 of CC2340 EVM

Part Number: CC2340R5

Tool/software:

Hi Team,

We are using the example code: pwmled1 and remapping DIO8 as PWM output, but DIO8 can not measure any PWM signal.

(SDK: simplelink_lowpower_f3_sdk_8_10_01_02)

However, it is OK when we set PWM to DIO14.

Please help to provide comments.

Thanks.

  • Hi Mike,

    1. LGPT1 is going to initialize as a 16-bit counter (PWMTimerLPF3_getMaxCount -> LGPTimerLPF3_getCounterWidth max 0xFFFE) thus PWMTimerLPF3_getPeriodCounts is going to return a periodCount greater than the maximum when using dutyUnits of PWM_PERIOD_US and pwmPeriod greater than ~1350 (when using the equation periodCounts = ((uint64_t)counterFreq * (uint64_t)periodValue / 1000000) - 1; it exceeds 0xFFFE).  Thus the pwmPeriod should be reduced to 1300 or less.  Otherwise you will notice the code is trapped by a while loop because PWM_open returns NULL.
    2. PWMTimerLPF3.c only considers channelConfig[x].pin values, not nPin, thus complementary channels are an issue for the default PWM TI Driver.  You either have to modify PWMTimerLPF3.c and put this copy directly into your project workspace, or workaround the issue by adding a LGPT1 Channel 0 connection.

    Afterwards, you should be able to see the DIO8 PWM pin operating as intended

    Regards,
    Ryan