PWM on the FEZ Cerberus Mainboard

Hi Chris,

It is the nature on how PWM works on this STM processor.

To illustrate, let me describe the different PWM types:

Hydra and G400 have an independent PWM processor via being an Atmel brand processor.

Cerberus is an STM brand processor and does not have an independent PWM processor. Cerberus, like a lot of processors, generate thier PWM through the use of timers on the processor. Cerberus has many timers with four channels each. When the processor uses its timers as the PWM source, the timer frequency needs to be the same between channels but the period (duty cycle) can be different.

Here is a complete list of the timer to channel pins for the Cerbware:

//                         C6,A7,C7,A8,B0,B1,B5,B4,B3,B11,B10,A10,A9,A15, B8, B9
 #define STM32F4_PWM_TIMER { 8,14, 8, 1, 3, 3, 3, 3, 2,  2,  2,  1, 1,  2,  4,  4}
 #define STM32F4_PWM_CHNL  { 0, 0, 1, 0, 2, 3, 1, 0, 1,  3,  2,  2, 1,  0,  2,  3}
 #define STM32F4_PWM_PINS  {38, 7,39, 8,16,17,21,20,19, 27, 26, 10, 9, 15, 24, 25}

As you can see PWM_0 and PWM_2 share the same timer (TIM8) and therefore cannot be different frequencies, only different duty cycles. As you can also see, PWM_4 and PWM_5 are also on the same timer (TIM3) and therefore cannot have different frequencies, only different duty cycles.

We will be adding a chart to the developer page to better allow proper usage of the PWM in situations like these.

2 Likes