s3c2440a pwn模块学习笔记

本文介绍了 S3C2440A 微控制器中的五个 16 位定时器的功能及工作原理。重点阐述了四个具备脉宽调制 (PWM) 功能的定时器以及一个仅内部使用的定时器。文章详细解释了定时器的预分频器、时钟分频器等关键部件的工作机制,并说明了如何通过比较寄存器来实现 PWM 输出。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值