cancel
Showing results for 
Search instead for 
Did you mean: 

Why is there no output from TIM9 CH2 on PE6

GreenGuy
Senior III
Posted on October 24, 2017 at 01:21

I am using the STM32F429ZI.  I have setup four timers to slave from TIM3.  The timers are TM1, TM2, TM4, TM9.  All four are setup the same as PWM generators in One Pulse Mode and I have checked multiple times to make certain they are being triggered from the correct ITRx.  TM1,2,4 output on CH1 and TM9 on CH2.  TM1,2,4 create pulses on their output pins that match the expected delay and width, but TM9 does not output anything and is always low.  The configuration was setup in MXCube using the latest repository 1.16.0. 

I double checked the PE6 (pin5 in my case - 144 QFP) by setting it to a GPIO.  I am able to toggle the pin and the output behaves correctly. 

All else is working as expected with Ethernet, Uarts, and other GPIO. 

MXCube does not complain that pin resources are in violation. 

Either I am missing something subtle or basic, or that is a bug.

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on October 24, 2017 at 09:27

Set TIM9 CH2 up as a PWM Generator with internal clock checked (as before) with slave mode and trigger source disabled.

Check if TIM9's clock enabled in RCC. Note that TIM9 is on APB2.

Read out and check or post TIM9 registers' content. Check in debugger (or craft code in main()) if TIM9_CNT is counting up. Check if ARR is higher than CCR2. Check if proper mode is set to channel 2 in CCMR1 and channel 2 is enabled in CCER. Try CH1 on TIM9.

Also check in GPIO registers for given pin if it is set to AF in MODER and to proper AF number in AFRL/AFRH, and it's not OC.

JW

View solution in original post

6 REPLIES 6
Posted on October 24, 2017 at 01:31

Run a plain unconditional continuous PWM on that TIM9 CH2.  If that works and you setup still does not, then read out and check or post TIM9 registers.

JW

Posted on October 24, 2017 at 03:10

Set TIM9 CH2 up as a PWM Generator with internal clock checked (as before) with slave mode and trigger source disabled.  Used the same hal call to start TIM9 as TIM3.

Output on 3, no output on 9.

Posted on October 24, 2017 at 04:19

Better confirm by reading the reference manual for TIM9 behaviour...

Posted on October 24, 2017 at 09:27

Set TIM9 CH2 up as a PWM Generator with internal clock checked (as before) with slave mode and trigger source disabled.

Check if TIM9's clock enabled in RCC. Note that TIM9 is on APB2.

Read out and check or post TIM9 registers' content. Check in debugger (or craft code in main()) if TIM9_CNT is counting up. Check if ARR is higher than CCR2. Check if proper mode is set to channel 2 in CCMR1 and channel 2 is enabled in CCER. Try CH1 on TIM9.

Also check in GPIO registers for given pin if it is set to AF in MODER and to proper AF number in AFRL/AFRH, and it's not OC.

JW

Posted on October 24, 2017 at 09:30

AFAIK TIM9 in the classic 'F4 is functionally identical to TIM3-TIM4, except for less channels.

Am I missing something?

JW

Posted on October 24, 2017 at 18:59

JW thank you!

In the original eval with the Nucleo board TIM9 CH1 was used.  In porting the code to our custom board the channel was shifted to 2 due to pin conflict but the code was still loading CCR1.  Changing to CCR2 provides the correct output behavior.