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.

CC3200: PWM signal generate by DMA data example code applying

Part Number: CC3200

dear all,

i used cc3200 in my new project and need to generate PWM signal. i plan to use DMA transfer data to create the PWM. do we have some guides or example code to realize this function? 

thanks a lot. :)

  • Hi Damien,

    I'm a bit confused by what you are trying to do.
    When you say "use DMA transfer data to create the PWM", do you mean taking bytes/words of data you get and encoding a PWM with that data like a UART?

    Or are you getting a specific PWM duty cycle/frequency/other parameters using DMA and need to rapidly change the PWM output to the desired characteristics?

    Clarifying this would allow me to better understand your use case and help you.

    Thanks,
    Michael
  • Hi michael,

    yes, just as your understanding, i want to get a specific pwm duty cycle  using DMA and need to change the PWM output rapidly.

    for example, i want to change PWM duty cycle at each pwm period just like 1%,2%,3%....,the wave should  like this:only one pulse with duty cycle 1%,then only one pulse with duty cycle 2%,and then one pulse with duty 3%...,i want to use DMA to implement this

    thanks

  • Hi Jack,

    The PWM outputs on the CC3200 are generated through general purpose timers. These timers are only connected to the DMA to generate DMA requests, not to take data from DMA directly.

    In order to accomplish what you want, every PWM duty cycle you will have to do the following in software:
    1. Check the requested duty cycle, by looking at the data transferred by DMA when you get the falling edge interrupt from the timer indicating that the PWM is now in the low state.
    2. Set the duty cycle to the new value by writing to the match register of the timer.
    3. Issue another DMA transfer request, to get new PWM duty cycle data that will be used on the next falling edge.

    This might be possible, but I do not have any example of this on the CC3200. It would depend on the PWM frequency required to see if it is possible to perform all of this in time for the next PWM duty cycle. The problem with the steps above is that they have to be accomplished within the amount of time that the PWM is in the low state.

    You will have to do some testing with your use case to see whether or not you can change the PWM settings within those timing constraints, since whether or not this works is dependent on the PWM frequency and the max duty cycle needed.

    Regards,
    Michael
  • Hi Jack,

    I assume that you have resolved your issue since I haven't heard back from you. If not, please feel free to post here on this thread or open a new one regarding the issue.

    Regards,
    Michael
  • dear michael,
    your advice is very helpful, many thanks.