Programming PWM using the TC-module in SAM3X8E


I have certains ideas regarding programming PWM using SAM3X8E-microcontroller on Arduino Due and would appreciate your feedback.

The SAM3X8E-datasheet states that it is possible to use the TC module to generate PWM signals. I have one idea for how to do this, and please correct me if I’m wrong: you can configure a TC-channel in waveform mode and generate a square wave on TIOA/B. TIOA/B can be multiplexed with PIO-pins, on which you can then output the square wave signal. The PWM signal period depends on the counter value of the TC-channel used; the signal goes high on RA compare and low on RC compare. Thus you can change the duty cycle by regulating these two values. Is this how they imagine that one can use the TC-module to generate a PWM-signal?

Another question arises: what need is there for a PWM module in the SAM3X8E? What does that add to the PWM-generating ability of the SAM3X8E-microcontroller?

It's corect, timer output compare feature may be apply to generate PWM. This only way for small AtMega AVR microcontrollers w/o special dedicated PWM block.
But, PWM in the Sam3x does much more than that:

Each channel controls two complementary square output
waveforms. Characteristics of the output waveforms such as period, duty-cycle, polarity and dead-times (also
called dead-bands or non-overlapping times) are configured through the user interface.

It's a big headache to generate complementary anti-phase with dead-bands using simple OC Timers, I can't say it's not possible using 2-timers in conjunction, but it's quite complicated on the software tracking all those settings.