The timers work well as interrupt sources, but there is undocumented funkiness going on when you try and use them to trigger other internal peripherals.
The worst part is the inconsistency of the ST documentation.
For example, to trigger an A2D conversion via a timer event as an external source, you select an event (e.g. TIM1_CH1 event) as an external trigger source for the A2D, and then go looking in vain for 'TIM1_CH1 event' in the timer documentation. What you find is U event (update), CC1l (on the diagram but not described, although CCIIE and CCI1F are described), OC1REF, OC1and TI1 along with ITR1 (for cascading timers, see the slave mode control register documentation for routing ). You can, though, generate a capture/compare event via the CC1G bit in the TIMx_EGR register.
The tricky bit is that the event (at least for the purpose of triggering an A2D) is only generated when the timer is in TIMER_PWM mode, not in TIMER_OUTPUT_COMPARE mode (even via SW changes to the EGR register).
So basically different teams documented different peripherals and no one focused on the inter peripheral communications for us poor users.
Awesome when its working. Be sure and look for code examples, though, when stuff isn't working, rather than just assuming its something you mis-read in the documentation.
gbulmer gives you a good line on the basics of timers. Here are a few more things that aren't immediately obvious:
- the capture compare pins are both inputs and outputs; that's the same pin on both sides of the diagram. Also they can be clock source inputs (channel 1 and 2 anyway in external clock mode 1)
- the ETF pin is both an external trigger and an external clock input (external clock mode 2).
- the slave mode control register is poorly named. It is used to select other external clock sources as well as configuring slave mode (i.e. slave mode select field (SMS)).
- note the path from TIMx_CH1 to TI1 to T1FP1 to IC1 to OC1REF to OC1 and back to TIMxCH1, on the diagram. That really helps to decode the documentation
- for the new user, check out the alternate function section of GPIO, to move the signal pins around and enable them