Count capture resources rather than timer names

A timer instance name is an identifier, not a count of peripherals. AN4776 explicitly warns that the number in a TIM name does not indicate how many timers the MCU contains. It also notes differences across STM32 families, including exceptions where similarly named instances do not have identical features. A familiar peripheral name is therefore an incomplete resource requirement.

Distinguish the timer instance, its time base and its capture/compare channels. They describe different parts of the architecture. A timer can supply channels that interact with external signals, while the physical mapping of those channels remains an additional device-specific question. Counting timers without identifying channel roles can leave the required event inputs unaccounted for.

Start the allocation with the capture functions the measurement needs, then relate them to the applicable instance and channel evidence. The general-purpose timer architecture provides vocabulary for that review; it does not identify the available alternate functions on an unknown package. This keeps a sourcing description from turning one STM32 family's instance names into a universal count or a promise that every listed channel reaches an available pin.

Relate the captured timestamp to the shared time base

Input capture associates an event with the timer's running count. ST explains that, after the selected input-conditioning and prescaler path detects the applicable event, the counter content is transferred to the channel's capture/compare register. The saved value is a timestamp in that counter's context, rather than a separate clock generated by the channel.

The time base includes the counter and its prescaling and reload context. Several channels belonging to the timer can therefore use a shared progression of count values. A channel count should not be expanded into the same number of independently configured counter time bases. The measurement may need shared timestamps, independently configured timing contexts, or a distinction between those requirements.

Preserve which events use which time base when allocating resources. This connects the stored timestamp to the counter behaviour that gives it meaning, instead of treating capture capability as a detached peripheral checkbox. It also separates available hardware structure from achieved measurement accuracy. The architectural transfer explains where the value comes from, without calculating time resolution, rollover handling or the result of an actual measurement implementation.

Allocate edge paths and paired channel roles

One external pulse stream can create more than one channel-role requirement. AN4776 describes filtered input paths and an arrangement that routes an input into another channel for rising- and falling-edge timestamp applications. The number of independent external signals is therefore not necessarily the same as the number of channel resources consumed by the desired measurement.

The useful distinction is among the physical input, the selected edge path and the capture destination. A measurement interested in both edges needs to preserve how those roles are realized in the applicable timer. The example demonstrates a resource-allocation question; it does not mean that any two channels on any STM32 can be paired or connected to any input.

Allocate the needed edge roles before accepting a headline channel count. That allows a designer to distinguish a shortage of input routes from a shortage of capture destinations or time bases. The exact-device documentation must then establish the usable arrangement. The general example supplies no arbitrary cross-channel routing permission, pin map or guarantee that all desired external functions can be used simultaneously.

Separate filtering from event decimation

Filtering and prescaling act at different points. ST describes an input filter that rejects pulses according to its sampling configuration. This changes which input pulses reach the subsequent detection path as valid events. It is an input-qualification role, rather than a second name for slowing the counter or recording fewer otherwise detected events.

The channel prescaler provides the event-selection role: it determines which detected edges cause capture. The time-base prescaler instead changes the progression of the counter whose content will be saved. These functions can all reduce activity in some sense, but they change different information. Treating them as one divider setting would conceal whether the requirement concerns pulse qualification, event decimation or the timestamp's counting basis.

Keep the three roles explicit when describing the measurement resource. This lets the available timer architecture be compared with the actual kind of event information needed, instead of choosing a setting from the general example. AN4776 supplies the mechanism distinction; it does not establish filter values, firmware, DMA capacity or timestamp accuracy for the proposed MCU and signal. Those implementation conclusions remain outside the resource description.

Sources and further reading

ST AN4776 Rev 4, physical pages 1, 6–7, 9–11 and 13–14: general timer/capture and filtering prose. Code, register settings, exact-device counts, pin routes, DMA capacity and achieved accuracy are not supplied.