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.

PWM on cc2538

Other Parts Discussed in Thread: CC2538

Hi ,

For PWM drivers on cc2538 in contiki , I have ported the drivers  I have mainly ported the gptimer.c , interuppt.c drivers in contiki/cpu/dev directory , and  started using them ...  Are all the drivers a must for PWM ? as i see timer load values arent reflected on when i try it on target. Can anyone please help ?
Can anyone provide PWM Example in case im missing something...? I have refrred the Example proviedby driverlib they are no examples relevant to duty cycle change relevant.

  • Hi,


    Follow this discussion

  • Hi Igor/ Antonio ,

    I got the driver working  , thanks for that., but i have a problem

    /* set the period */

      REG(GPT_2_BASE+ GPTIMER_TAILR) = 0x1A5;   < decimal val = 421>
      /* Set the deassert period */
      REG(GPT_2_BASE + GPTIMER_TAMATCHR) = 0xD3;  <decimal value = 211>

    421 is the period and 211 is deassert period.   Where ontime = 50 % and off time =50 %   <which is 50% duty cycle>

    So when timer start counting from 421 the pin is 1   ..and on reaching 211 the timer disables the pin to 0 .. till the counter reaches to zero.
     And again when the timer resstart the pin is high for complete 421 period .... so is there a way other than using a loop  which will set he deassert period of 211

    Do we have any other configuration in timer where the deaasert period remains set for ever till the timer s disbled.

    Thanks

    Manoj sony

  • Hi,

    Follow the configurations described in section 11.3.2.4 of the CC2538 user's guide