2017-10-23 04:21 PM
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.
Solved! Go to Solution.
2017-10-24 02:27 AM
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
2017-10-23 04:31 PM
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
2017-10-23 08:10 PM
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.
2017-10-23 09:19 PM
Better confirm by reading the reference manual for TIM9 behaviour...
2017-10-24 02:27 AM
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
2017-10-24 02:30 AM
AFAIK TIM9 in the classic 'F4 is functionally identical to TIM3-TIM4, except for less channels.
Am I missing something?
JW
2017-10-24 11:59 AM
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.