比較的安価に購入できる STM32 ボード。cortex-M が載ってます。
タイマーが多数内蔵されていますけど、機能のバリエーションがあります。
どれを使えばいいんじゃい!どう違うんじゃい! と言うのを自分のためにまとめました。
データシート(reference manual)の章の頭を持ってきました。細部には差があるのかもしれません。
もしかして、公式に機能比較があったりする?
STM32F303 から持ってきましたが、TIMx の x を気にすればいいようです。
(日本語が不自由ですみません。 例:STM32F103 の TIM2 は 303 の TIM2 と(ほぼ?)同じ。)
TIMx → | (ソート用) | 1 | 8 | 20 | 2 | 3 | 4 | 6 | 7 | 15 | 16 | 17 | note |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
↓機能 | 0 | adv | adv | adv | gen | gen | gen | bas | bas | gen | gen | gen | adv :advanced-control, bas:basic, gen:general-purpose |
• 16-bit up, down, up/down auto-reload counter. | 1 | v | v | v | v3 | v | v | v3: 32bit support | |||||
• 16-bit auto-reload upcounter | 1.2 | v | v | v | v | v | |||||||
• 16-bit programmable prescaler allowing dividing (also “on the fly”) the counter clock frequency either by any factor between 1 and 65536. | 2 | v | v | v | v | v | v | v | v | v | v | v | |
Up to N independent channels for: | 3 | 6 | 6 | 6 | 4 | 4 | 4 | 2 | 2 | 2 | |||
– Input Capture (but channels 5 and 6) | 3.1 | v | v | v | v | v | v | v | v | v | |||
– Output Compare | 3.2 | v | v | v | v | v | v | v | v | v | |||
– PWM generation (Edge and Center-aligned Mode) | 3.3 | v | v | v | v | v | v | v | v2 | v2 | v2: not support for center- mode | ||
– One-pulse mode output | 3.4 | v | v | v | v | v | v | v | v | v | |||
• Complementary outputs with programmable dead-time | 8 | v | v | v | v1 | v | v | v1:for ch1 only | |||||
• Synchronization circuit to control the timer with external signals and to interconnect several timers together. | 9 | v | v | v | v | ||||||||
• Synchronization circuit to control the timer with external signals and to interconnect several timers. | 10 | v | v | v | |||||||||
• Repetition counter to update the timer registers only after a given number of cycles of the counter | 11 | v | v | v | v | v | v | ||||||
• 2 break inputs to put the timer’s output signals in a safe user selectable configuration. | 14 | v | v | v | |||||||||
• Interrupt/DMA generation on the following events: | 15 | v | v | v | v | ||||||||
– Update: counter overflow/underflow, counter initialization (by software or internal/external trigger) | 15.1 | v | v | v | v | v | v | v | |||||
– Update: counter overflow | 15.11 | v | v | v | v | v | v | v | v | v | v | v | |
– Trigger event (counter start, stop, initialization or count by internal/external trigger) | 15.2 | v | v | v | v | v | v | v | v | v | |||
– Input capture | 15.3 | v | v | v | v | v | v | v | v | v | |||
– Output compare | 15.4 | v | v | v | v | v | v | v | v | v | |||
– Break input (interrupt request) | 15.5 | v | |||||||||||
– Break input | 15.7 | v | v | ||||||||||
• Supports incremental (quadrature) encoder and Hall-sensor circuitry for positioning purposes | 21 | v | v | v | v | v | v | ||||||
• Trigger input for external clock or cycle-by-cycle current management | 22 | v | v | v | v | v | v | ||||||
• Break input to put the timer’s output signals in the reset state or a known state | 37 | v | v | v | |||||||||
• Synchronization circuit to trigger the DAC | 66 | v | v |
あ、公式に似たのがありました → AN4013 (http://www.st.com/content/st_com/en/search.html#q=AN4013-t=resources-page=1)