| 数据搜索系统,热门电子元器件搜索 |
|
AN913 数据表(PDF) 3 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN913 数据表(HTML) 3 Page - STMicroelectronics |
|
3 / 12 page ![]() 3/12 PWM GENERATION WITH THE ST62 16-BIT AUTO-RELOAD TIMER 2 PULSE WIDTH MODULATION (PWM) GENERATION Using the PWM generation capability of the ARTimer, the CPU of the microcontroller has only to start/stop the timer and update the duty cycle. High speed PWM signals in the range of up to 4 MHz can be generated (RLCP=1). The timer clock input frequency fint can be selected by the oscillator clock fosc and the prescaler ratio (PSC2,PSC1 bits of SCR1 register). The PWM signal period is controlled by the Reload register RLCP. The duty cycle is defined by the Com- pare register CMP (see Figure 2.). The TC register is decremented from the RLCP value to 0, then reloaded at the RLCP value to decrement again. The PWM output is set or reset or toggled when MASK&TC=0 (de- pending on the PWMPOL bit of the SCR4 register and the PWMMD bit of the SCR3 register) and is reset or set or toggled when MASK&TC=MASK&CMP. The CMP register can have any value between the RLCP value and 0, but in PWM mode, this CMP register value should not be equal to zero. So the RLCP value should be as high as possible, the MASK value equal to FFFFh and the prescaler ratio as low as possible to achieve maximum resolution. Major equations for PWM generation are: fint = fosc / (prescaler ratio) fPWM = fosc / ((RLCP+1)*prescaler ratio) With PWMPOL=0 Duty cycle: (RLCP-CMP) / (RLCP+1) With PWMPOL=1 Duty cycle: (CMP+1) / (RLCP+1) Resolution: 1 / (RLCP+1) With a 8 MHz oscillator and a prescaler ratio of 1, the maximum resolution (1/(RLCP=FFFFh)) leads to a PWM frequency fPWM of 122Hz. In this case an analog lowpass filter with a high order gives an analog output equivalent to a 16 bit DAC! Table 1. Prescaler Programming Ratio PSC2 PSC1 PRESCALER Ratio 0 0 Clock Disabled 01 1 10 4 11 16 |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |