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.

CCS/TMS320F28335: Generating a 9 MHz square wave

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi.

I am working on a project where I need to generate a 9 MHz square wave from the f28335 controlCARD. I am unable to do this by simply toggling the GPIOs at 9 MHz speed because it is maxing out at ~3.4 MHz. Going through some of the other threads I discovered that a square wave can be generated up to 25 MHz using the epwm feature of the MCU. I want to ask how do I go about doing this. I am looking through the data sheet but I am having some trouble figuring out the configuration for a 9MHz square wave with a 50% duty cycle. Any suggestion would be much appreciated. Thank you.

Tolu. 

  • Hi,

    Please refer to the C2000Ware examples on EPWM module : C2000Ware_2_00_00_02\device_support\f2833x\examples\epwm_up_aq

     

    Basically let say if you are operating EPWM in UP-counter mode , then for generating 9Mhz signal of 50% duty :

    TBPRD = (SYSCLK / 9Mhz) - 1 

                                                                                               TBPRD = 90/9 - 1 = 9                                     (Assuming SYSCLK is 90Mhz for F2833x) 

    COMPA = (TBPRD + 1) / 2 = 5

     

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu

     

  • Thank you very much Himanshu. I was able to generate the 9 MHz signal.