- pwm相关手册说明
These timers can be used to generate internal interrupts to the ARM subsystem. In addition, Timers 0, 1, 2, and 3include a PWM function (Pulse Width Modulation) which can drive an external I/O signal. The PWM for timer 0 has a optional dead-zone generator capability, which can be utilized to support a large current device. Timer 4 is only an internal timer with no output pins.
这些定时器在ARM子系统中产生一个内部中断。另外,定时器0、1、2、3包含一个PWM功能,来驱动一个外部I/O信号。PWM定时器0有一个支持死区发生器能力,支持大电流设备,定时器4是一个内部定时器,没有引脚输出。
The Timers are normally clocked off of a divided version of the APB-PCLK. Timers 0 and 1 share a programmable 8-bit prescaler that provides the first level of division for the PCLK. Timer 2, 3, and 4 share a different 8-bit prescaler. Each timer has its own, private clock-divider that provides a second level of clock division (prescaler divided by 2, 4, 8, or 16). Alternatively, the Timers can also select a clock source from an external pin, except Timer 4. Timers 0 and 1 can select the external clock TCLK0. Timers 2 and 3 can select the external clock TCLK1. Timer 4 operates with APB-PCLK only.
定时器通常由APB-PCLK的分频提供时钟。定时器0和1共享一个可编程的8位预分频器,为PCLK提供第一级分频。 定时器2、3和4共享一个不同的8位预分频器。每个定时器都有自己的专用时钟分频器,提供第二级时钟分频(预分频器除以2,4,8或16)。除定时器4外,定时器还可从外部引脚选择一个时钟源。定时器0和1可选择外部时钟TCLK0。 定时器2和3可以选择外部时钟TCLK1。 定时器4仅使用APB-PCLK进行操作。
Each timer has its own 32-bit down-counter which is driven by the timer clock. The down-counter is initially loadedfrom the Timer Count Buffer register (TCNTBn). When the down-counter reaches zero, the timer interrupt requestis generated to inform the CPU that the timer operation is completed. When the timer down-counter reaches zero,the value of corresponding TCNTBn can be automatically reloaded into the down-counter to start the next cycle.However, if the timer stops, for example, by clearing the timer enable bit of TCONn during the timer running mode, the value of TCNTBn is not reloaded into the counter.
每个定时器都有自己的32位递减计数器,由定时器时钟驱动。 递减计数器最初从定时器计数缓冲寄存器(TCNTBn)加载。 当减计数器达到零时,产生定时器中断请求以通知CPU定时器操作完成。 当定时器减计数器达到零时,对应的TCNTBn的值可以自动重新加载到减计数器中以开始下一个循环。然而,如果定时器停止,例如:在定时器运行模式下,清除定时器的使能位TCONn,TCNTBn的值是不能重加载到计数器的。
The Pulse Width Modulation function (PWM) uses the value of the TCMPBn register. The timer control logic changes the