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.

CC1310: PWM output on DIO

Hi,

I would like to use the PWM drivers to generate a 2MHz , 20% duty cycle(fixed) signal. I understand how to use the PWM drivers.

But I am not sure how to put the PWM output on a DIO.

Please suggest the way to put the PWM output on the DIO.

Thanks & regards,

Ankur

  • Hi Ankur,

    you can specify the pin in a board source file. As most TI-RTOS drivers, the PWM driver requires some global configuration objects in the board source file. Here is the relevant section from CC1310DK_7XD.c which comes with TI-RTOS:

    PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1310DK_7XD_PWMCOUNT] = {
        { .pwmPin = Board_PWMPIN0, .gpTimerUnit = Board_GPTIMER0A },
        { .pwmPin = Board_PWMPIN1, .gpTimerUnit = Board_GPTIMER0B },
        { .pwmPin = Board_PWMPIN2, .gpTimerUnit = Board_GPTIMER1A },
        { .pwmPin = Board_PWMPIN3, .gpTimerUnit = Board_GPTIMER1B },
        { .pwmPin = Board_PWMPIN4, .gpTimerUnit = Board_GPTIMER2A },
        { .pwmPin = Board_PWMPIN5, .gpTimerUnit = Board_GPTIMER2B },
        { .pwmPin = Board_PWMPIN6, .gpTimerUnit = Board_GPTIMER3A },
        { .pwmPin = Board_PWMPIN7, .gpTimerUnit = Board_GPTIMER3B },
    };

    The Board_PWMPIN macros represent IOIDs and are defined in the header file. You can just replace them with any IOID you want. Personally, I think that the TI-RTOS PWM driver is a little bit clunky and oversized. I showed you a straight forward way of using the PWM in this post. Just replace Board_LED2 by any IOID you like.