匿名
未登录
登录
百问网嵌入式Linux wiki
搜索
查看“TIM internal peripheral”的源代码
来自百问网嵌入式Linux wiki
名字空间
页面
讨论
更多
更多
页面选项
Read
查看源代码
历史
←
TIM internal peripheral
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
==Article purpose== The purpose of this article is to * briefly introduce the '''TIM''' peripheral and its main features * indicate the level of security supported by this hardware block * explain how each instance can be allocated to the three runtime contexts and linked to the corresponding software components * explain how to configure the TIM peripheral ==Peripheral overview== The TIM peripheral is a multi-channel timer unit, available in various configurations, depending on the instance used. There are basically following categories: advanced-control timers, general-purpose timers and basic timers. The TIM can provide: PWM with complementary output and dead-time insertion, break detection, input capture<ref name="input_capture">[https://en.wikipedia.org/wiki/Input_capture Input capture]</ref>, quadrature encoder<ref name="quadrature_encoder">[https://en.wikipedia.org/wiki/Rotary_encoder#Incremental_encoder Quadrature encoder]</ref> interface (typically used for rotary encoders), trigger source for other internal peripherals like: ADC<ref name="adc_internal">[[ADC internal peripheral]]</ref>, DAC<ref name="dac_internal">[[DAC internal peripheral]]</ref>, DFSDM<ref name="dfsdm_internal">[[DFSDM internal peripheral]]</ref>. ===Features=== The '''TIM''' peripheral is available in different configurations, depending on the selected instance : * TIM1 and TIM8 are advanced-control timers, with 6 independent channels. * TIM2, TIM3, TIM4 and TIM5 are general-purpose timers, with 4 independent channels. * TIM12, TIM13 and TIM14 are general-purpose timers, with 2 (TIM12) or 1 (TIM13 and TIM14) independent channels. * TIM15, TIM16 and TIM17 are also general-purpose timers, with 2 (TIM15) or 1 (TIM16 and TIM17) independent channels. Compare to TIM12, TIM13 and TIM14, this configuration brings some features that are very useful for motor control (like break function, DMA burst mode control, complementary output with dead-time insertion, ...) * TIM6 and TIM7 are basic timers Refer to [[STM32MP15 resources#Reference manuals|STM32MP15 reference manuals]] for the complete list of features, and to the software components, introduced below, to know which features are really implemented. ===Security support=== The TIM is a '''non-secure''' peripheral. ==Peripheral usage and associated software== ===Boot time=== The TIM is not used at boot time. ===Runtime=== ====Overview==== '''TIM12''' and/or '''TIM15''' can be allocated to: * the Arm<sup>®</sup> Cortex<sup>®</sup>-A7 secure core to be controlled in the secure monitor ([[TF-A overview|TF-A]] or [[OP-TEE overview|OP-TEE]]), to perform HSI and CSI calibrations<ref>[[How to activate HSI and CSI oscillators calibration]]</ref> in [[RCC internal peripheral|RCC]]. <br /> '''All TIM instances''' can be allocated to: *the Arm<sup>®</sup> Cortex<sup>®</sup>-A7 non-secure to be controlled in Linux<sup>®</sup> by the [[PWM overview|PWM]] and/or the [[IIO overview|IIO]] frameworks. or * the Arm<sup>®</sup> Cortex<sup>®</sup>-M4 to be controlled in STM32Cube MPU Package by [[STM32CubeMP1 architecture|TIM HAL driver]] <br /> Note that RCC<ref name="rcc">[[RCC internal peripheral]]</ref> owns one prescaler per '''TIM group''' corresponding to '''APB1''' and '''APB2''' buses: TIMG1PRE and TIMG2PRE, respectively. The allocation to Cortex-A7 or the Cortex-M4 should ideally be done on a per group basis to get independent clocking setup on each side, this is why the TIM instances groups are shown in the summary table below ([[#Peripheral assignment]]). ====Software frameworks==== {{:Internal_peripherals_software_table_template}} | Core/Timers | [[TIM internal peripheral|TIM]] | [[TF-A_overview|TF-A TIM driver]]<br />[[OP-TEE_overview|OP-TEE TIM driver]] | [[PWM overview|Linux PWM framework]]<br>[[IIO overview|Linux IIO framework]] | [[STM32CubeMP1 architecture|STM32Cube TIM driver]] | |- |} ====Peripheral configuration==== The configuration is applied by the firmware running in the context to which the peripheral is assigned. The configuration by itself can be performed via the [[STM32CubeMX]] tool for all internal peripherals. It can then be manually completed (especially for external peripherals) according to the information given in the corresponding software framework article. For Linux kernel configuration, please refer to [[TIM device tree configuration]] and [[TIM Linux driver]] articles. ====Peripheral assignment==== {{:Internal_peripherals_assignment_table_template}} <onlyinclude> | rowspan="14" | Core/Timers | rowspan="14" | [[TIM internal peripheral|TIM]] | TIM1 (APB2 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM2 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM3 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM4 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM5 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM6 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM7 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM8 (APB2 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM12 (APB1 group) | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM13 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM14 (APB1 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM15 (APB2 group) | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM16 (APB2 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- | TIM17 (APB2 group) | | <span title="assignable peripheral" style="font-size:21px">☐</span> | <span title="assignable peripheral" style="font-size:21px">☐</span> | Assignment (single choice) |- </onlyinclude> |} ==How to go further== STM32 cross-series timer overview<ref name="stm32_cross_series_timer_overview">[http://www.st.com/content/ccc/resource/technical/document/application_note/54/0f/67/eb/47/34/45/40/DM00042534.pdf/files/DM00042534.pdf/jcr:content/translations/en.DM00042534.pdf STM32 cross-series timer overview application note]</ref> application note. ==References== <references/>
该页面使用的模板:
Internal peripherals assignment table template
(
查看源代码
)
Internal peripherals software table template
(
查看源代码
)
模板:STDarkBlue
(
查看源代码
)
模板:STLightBlue
(
查看源代码
)
模板:STLightGrey
(
查看源代码
)
模板:STPink
(
查看源代码
)
返回至
TIM internal peripheral
。
导航
导航
WIKI首页
官方店铺
资料下载
交流社区
所有页面
所有产品
MPU-Linux开发板
MCU-单片机开发板
Linux开发系列视频
单片机开发系列视频
所有模块配件
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志