s3c2440a pwn模块学习笔记

来源:互联网 发布:淘宝开个充值店怎么样 编辑:程序博客网 时间:2024/05/01 19:34

10 PWM TIMER

OVERVIEW

The S3C2440A has five 16-bit timers. Timer 0, 1, 2, and have Pulse Width Modulation (PWM) function. Timer has

an internal timer only with no output pins. The timer has deadzone generator, which is used with large current device.The timer and share an 8-bit prescaler, while the timer 2, and share other 8-bit prescaler. Each timer has aclock divider, which generates different divided signals (1/2, 1/4, 1/8, 1/16, and TCLK). Each timer block receivesits own clock signals from the clock divider, which receives the clock from the corresponding 8-bit prescaler. The 8-bit prescaler is programmable and divides the PCLK according to the loading value, which is stored in TCFG0 and TCFG1 registers.

The timer count buffer register (TCNTBn) has an initial value which is loaded into the down-counter when the timer is enabled. The timer compare buffer register (TCMPBn) has an initial value which is loaded into the compare register to be compared with the down-counter value. This double buffering feature of TCNTBn and TCMPBn makes the timer generate stable output when the frequency and duty ratio are changed.Each timer has its own 16-bit down counter, which is driven by the timer clock. When the down counter reaches zero, the timer interrupt request is generated to inform the CPU that the timer operation has been completed. When the timer counter reaches zero, the value of corresponding TCNTBn is automatically loaded into the down counter to continue the next operation. However, if the timer stops, for example, by clearing the timer enable bit of TCONn during the timer running mode, the value of TCNTBn will not be reloaded into the counter. The value of TCMPBn is used for pulse width modulation (PWM). The timer control logic changes the output level when the down-counter value matches the value of the compare register in the timer control logic. Therefore, the compare register determines the turn-on time (or turn-off time) of PWM output.