cancel
Showing results for 
Search instead for 
Did you mean: 

Can TIM2_CH1 (not ETR) be remapped to PA15? Or anywhere?

dale2
Associate II
Posted on January 19, 2010 at 11:49

Can TIM2_CH1 (not ETR) be remapped to PA15? Or anywhere?

5 REPLIES 5
dale2
Associate II
Posted on May 17, 2011 at 13:38

I'm trying to build a 16 channel PWM generator using the STM3210C-EVAL board. Actually, any STM32 part with 4 timers and unambiguously remappable outputs would work.

Using TIM2, TIM3, TIM4 and TIM5 in PWM mode, I can get everything routed by remapping TIM2, *except* TIM2_CH1. Without remapping, it would be routed to PA0, which is also the output of TIM5_CH1, which does not have a remapping option.

The reference manual indicates in ''full remap mode'' for TIM2 that:

''11: Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11)''

which I find somewhat confusing. Is it TIM2_ETR? TIM2_CH1?

Well, it doesn't seem to be TIM2_CH1, as it remains at a high level at all times, while all of the other PWM outputs are operating correctly.

My question is: How to route TIM2_CH1 output to a pin that doesn't conflict with one of the other general-purpose timers (TIMx) outputs?

Thanks!

Dale Wheat

http://dalewheat.com

raptorhal
Associate II
Posted on May 17, 2011 at 13:38

Dale:

1. See Figure 94 and Note 2 of Table 27 in the All Densities Reference Manual for an explanation of CH1 vs. ETR.

2. PA15 and PB3 are also used by JTAG unless you reconfigure to SWD mode. See Table 19.

3. If the above didn't help, post your code so we can see if we can spot the problem.

Cheers, Hal

dale2
Associate II
Posted on May 17, 2011 at 13:38

Hal,

Thank you for the prompt reply to my question!

I must be looking at a different revision of the Reference Manual than you are. I downloaded the latest RM0008 Refence Manual from:

http://www.st.com/stonline/products/literature/rm/13902.pdf

Here I find Table 20 ''General-purpose timers TIM2/3/4/5'' and the selection between _CHx and _ETR. This depends on the GPIO configuration, which I have set as ''Alternate function push-pull (50 MHz)'' on all PWM outputs. I see no footnotes here. Is this what you indicated above?

I've tried all combination of 2/10/50 MHz alternate function, push-pull configurations on this pin. It remains in a logic-high state. There are no JTAG adapters attached to the STM3210C-EVAL board.

Bear in mind that all 15 other PWM outputs, both remapped and not remapped, are working perfectly. Just PA15 is being naughty.

Also, I'm not using JTAG in this example. It's a trivial ''proof-of-concept'' design and I'm simply using the serial bootloader to program the part.

Any thoughts?

Thanks,

Dale Wheat

http://dalewheat.com

raptorhal
Associate II
Posted on May 17, 2011 at 13:38

Dale:

I have been using the January 2009 version. Thanks for the update notice.

Figure 94 and Table 27 are now Figure 100 and Table 42. Table 19 is now Table 34.

Even though you are not using the JTAG connector, PA15 is pulled high to 3.3V with a 10K pullup resistor. See the JTAG schematic in the EVAL Reference Manual. That might be the cause of the ''strange'' behavior.

Cheers, Hal

dale2
Associate II
Posted on May 17, 2011 at 13:38

Hal,

Yes! Now that we are looking at the same page, I see what you were trying to tell me. The SW/JTAG functionality has to be disabled to allow PA15 to be used a TIM2_CH1 instead of TDI. I flipped one bit (SWJ_CFG1 in AFIO_MAPR) and it works! Yay!

Thanks for helping me with this confusion on my part. I really appreciate it!

Thanks,

Dale Wheat

http://dalewheat.com