Forums DSP/DSC Boards TMS320F2812 Generate Simple PWM in TMS320F2812 kit

Generate Simple PWM in TMS320F2812 kit

Link to this post 22 Feb 13


Am trying to implement simple PWM in TMS320F2812 controller. I have configured the following registers as described in the Event Manager.


2) T1CON

3) T1CNT


5) T1PER


After I compile the program, it shows no errors, even after building the program, there are zero errors. But When I connect a CRO to TPWM1, it does not show the expected PWM waveform. It shows a logic high signal. Kindly tell me If i need to configure any other register in the program.

Thank you,

Link to this post 23 Feb 13


To generate a PWM output with a GP timer, a continuous up- or up-/down- counting mode can be selected. Edge-triggered or asymmetric PWM wave- forms are generated when a continuous-up count mode is selected. Centered or symmetric PWM waveforms are generated when a continuous-up/-down mode is selected. To set up the GP timer for the PWM operation, do the following:

  • Set up TxPR according to the desired PWM (carrier) period

    Set up TxCON to specify the counting mode and clock source, and start the operation

  • Load TxCMPR with values corresponding to the on-line calculated widths (duty cycles) of PWM pulses

The period value is obtained by dividing the desired PWM period by the period
of the GP timer input clock, and subtracting one from the resulting number
when the continuous up-counting mode is selected to generate asymmetric
PWM waveforms. When the continuous up-/down-counting mode is selected
to generate symmetric PWM waveforms, this value is obtained by dividing the
desired PWM period by two times the period of the GP timer input clock.

The GP timer can be initialized the same way as in the previous example. Dur-
ing run time, the GP timer compare register is constantly updated with newly
determined compare values corresponding to the newly determined duty

Link to this post 04 Dec 13


i attached one tms320f2812 sample c program for pwm protocol. kindly i would like to know frequency of pwm in this source code, how may i change this pmw frequency ?

help me sir...

Many Thanks,

  1. PWM_F2812.txt
Link to this post 14 Dec 13

I am totally new to this field, so i don't know anything.
can u tell me how to generate a pwm signal for 3 phase inverter?
is there any reference or code? please tell me

Link to this post 16 Dec 13

Aditya ,

You can follow this forum from the beginning . if u want to use pwm, kindly have a brief study about event manager for TMS320F2812. find the attachment for event manager datasheet.

Could you please give more information to relpy your queries, Which DSP kit you using whether a pantech board or ezdspf2812 or your custom board and tell which Digital signal controller ex;TMS320F2812 ?

kindly post your queries in new topics at the following link:
it may useful for all.

please let me know once your problem solved.

Feel free to post here if you have any further query.
Thanks and Regards,

  1. 2812 EVENT MANAGER.pdf